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

ROS_WARN behaves like printf so for a std::string it'd be something like:

ROS_WARN( "%s", topicNameTrajInput.c_str() ); // (Format string and args for the format string)

I'd suggest use use the easier ROS_WARM_STREAM for a std::string, it behaves like std::cout, e. g.:

ROS_WARN_STREAM( topicNameTrajInput );

or with << operator and multiple args :

ROS_WARN_STREAM( topicNameTrajInput << " Hello world " << 1000 );