ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello,

get_logger() is part of the API of rclcpp::Node see the documentation.

In the example is called RCLCPP_INFO(get_logger(), ... or RCLCPP_INFO(this->get_logger(), ... because it's inside the class which extends the Node class. But if you want to use the logger outside a Node class you can use it in this way: RCLCPP_INFO(node->get_logger(), .... Or if you don't have an available node you can called it: `RCLCPP_ERROR(rclcpp::get_logger("string of the logger", ... )