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

Revision history [back]

ROS_INFO and other ROS log functions follow the same format as the standard C printf function. You can find more information here http://wiki.ros.org/rosconsole and http://www.cplusplus.com/reference/cstdio/printf/

The ones you mention:

int decimal_integer_value = 5;
float float_pont_value = 10.0f;
ROS_INFO("%d", decimal_integer_value);
ROS_INFO(%i", decimal_integer_value);
ROS_INFO("%f", float_point_value);

Would output:

 5
 5
 10.0

%d and %i are equivalent and use to print decimal integer values, %f is used to print floating point numbers

ROS_INFO and other ROS log functions follow the same format as the standard C printf function. You can find more information here http://wiki.ros.org/rosconsole and http://www.cplusplus.com/reference/cstdio/printf/

The ones you mention:

int decimal_integer_value = 5;
float float_pont_value = 10.0f;
ROS_INFO("%d", decimal_integer_value);
ROS_INFO(%i", ROS_INFO("%i", decimal_integer_value);
ROS_INFO("%f", float_point_value);

Would output:

 5
 5
 10.0

%d and %i are equivalent and use to print decimal integer values, %f is used to print floating point numbersnumbers"