ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The non-stream versions take c-style strings, so they work with something like this:
ROS_INFO("a c-style string");
If you want to print a std::string you can do it one of two ways:
ROS_INFO(s.c_str()); // this prints a C-style string
ROS_INFO_STREAM(s);
For your message, this should work:
ROS_INFO_STREAM(msg);
2 | No.2 Revision |
The non-stream versions take c-style strings, C-style strings (a null terminated character array), so they work with something like this:
ROS_INFO("a c-style string");
If you want to print a std::string you can do it one of two ways:
ROS_INFO(s.c_str()); // this prints a C-style string
ROS_INFO_STREAM(s);
For your message, this should work:
ROS_INFO_STREAM(msg);