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

Just use Definition::value() in ros::message_traits, specifying the template type. For your example to print the definition of sensor_msgs/Joy:

std::cout << ros::message_traits::Definition<sensor_msgs::Joy>::value() << std::endl

This assumes you have the appropriate includes.

click to hide/show revision 2
Slightly better wording

Just use Definition::value() in ros::message_traits, specifying the template type. For Following your example example, to print the definition of sensor_msgs/Joy: in the console, simply write:

std::cout << ros::message_traits::Definition<sensor_msgs::Joy>::value() << std::endl

This assumes you have the appropriate includes.

Just use Definition::value()ros::message_traits::Definition<Type>::value() in ros::message_traits, specifying the template type. . Following your example, to print the definition of sensor_msgs/Joy in to the console, simply write:

std::cout << ros::message_traits::Definition<sensor_msgs::Joy>::value() << std::endl

This assumes you have the appropriate includes.