ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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.
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.
3 | Clearer answer |
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.