tud-phi/ros2-mocap_optitrack

Replace printf with ROS logging for ROS nodes

Closed this issue · 1 comments

Please replace all printf with the official ROS logging in all ROS nodes as for example here:

https://github.com/tud-cor-sr/ros2-mocap_optitrack/blob/master/mocap_optitrack_client/src/MoCapPublisher.cpp#L57

The ROS logging adds further information such as a severity level to the logging message. It for example is called like this:

RCLCPP_INFO(get_logger(), "Publishing: '%s'", msg->data.c_str());

https://github.com/ros2/demos/blob/foxy/logging_demo/src/logger_usage_component.cpp#L64

You can find further information about ROS2 logging here:
https://docs.ros.org/en/foxy/Concepts/About-Logging.html
https://docs.ros.org/en/foxy/Tutorials/Logging-and-logger-configuration.html

Please also replace all std::cout in the ROS nodes such as here:
https://github.com/tud-cor-sr/ros2-mocap_optitrack/blob/master/mocap_optitrack_w2b/src/WorldToBase.cpp#L107

Replaced with DEBUG, INFO and ERROR.