From 21b132c85fa0a2a2f2c42c7b4e9f273e54dbdcbb Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Mon, 14 Oct 2024 19:19:52 +0200 Subject: [PATCH] fix: recreate urcl log handler pointer if necessary --- ur_robot_driver/src/urcl_log_handler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ur_robot_driver/src/urcl_log_handler.cpp b/ur_robot_driver/src/urcl_log_handler.cpp index 809313d19..cf80ee3af 100644 --- a/ur_robot_driver/src/urcl_log_handler.cpp +++ b/ur_robot_driver/src/urcl_log_handler.cpp @@ -82,6 +82,9 @@ void UrclLogHandler::log(const char* file, int line, urcl::LogLevel loglevel, co void registerUrclLogHandler(const std::string& tf_prefix) { if (g_registered == false) { + if (g_log_handler == nullptr) { + g_log_handler = std::make_unique(); + } g_log_handler->setTFPrefix(tf_prefix); // Log level is decided by ROS2 log level urcl::setLogLevel(urcl::LogLevel::DEBUG);