From 1caf7f1c55e7f5f04c3511b19d172571e732f42e Mon Sep 17 00:00:00 2001 From: Bernd Pfrommer Date: Thu, 6 Jun 2024 16:04:15 -0400 Subject: [PATCH] print router id on startup (#189) * print router id on startup * Update rmw_zenoh_cpp/src/zenohd/main.cpp Signed-off-by: Yadu * Nit Signed-off-by: Yadunund --------- Signed-off-by: Yadu Signed-off-by: Yadunund Co-authored-by: Yadu Co-authored-by: Yadunund --- rmw_zenoh_cpp/CMakeLists.txt | 2 ++ rmw_zenoh_cpp/src/zenohd/main.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rmw_zenoh_cpp/CMakeLists.txt b/rmw_zenoh_cpp/CMakeLists.txt index cc8c6944..1e4c77db 100644 --- a/rmw_zenoh_cpp/CMakeLists.txt +++ b/rmw_zenoh_cpp/CMakeLists.txt @@ -104,12 +104,14 @@ install( add_executable(rmw_zenohd src/zenohd/main.cpp src/detail/zenoh_config.cpp + src/detail/liveliness_utils.cpp ) target_link_libraries(rmw_zenohd PRIVATE ament_index_cpp::ament_index_cpp rcutils::rcutils + rcpputils::rcpputils rmw::rmw zenohc::lib ) diff --git a/rmw_zenoh_cpp/src/zenohd/main.cpp b/rmw_zenoh_cpp/src/zenohd/main.cpp index 785e9664..fbd00210 100644 --- a/rmw_zenoh_cpp/src/zenohd/main.cpp +++ b/rmw_zenoh_cpp/src/zenohd/main.cpp @@ -32,6 +32,7 @@ #include #include "../detail/zenoh_config.hpp" +#include "../detail/liveliness_utils.hpp" #include "rmw/error_handling.h" @@ -188,7 +189,9 @@ int main(int argc, char ** argv) printf("Unable to open router session!\n"); return 1; } - + printf( + "Started Zenoh router with id %s.\n", + rmw_zenoh_cpp::liveliness::zid_to_str(z_info_zid(z_session_loan(&s))).c_str()); #ifdef _WIN32 SetConsoleCtrlHandler(quit, TRUE); #else