Quantcast
Viewing latest article 13
Browse Latest Browse All 18

Callback for integer message

Hello Folks, i am just leanring roscpp and i want to re-write the [Simple Publisher and Subscriber](http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber(c%2B%2B)) Tutorial with an integer instead of a string. So how have i to write the callback function? void chatterCallback(const std_msgs::UInt16 msg) { ROS_INFO("I heard: [%d]", msg->data);} } But `catkin_make` says: error: ‘UInt16’ was not declared in this scope Have i missed some additional headers so `std_msgs/UInt16` message isn't declared yet? The same problem also appears also for `ros::Publisher chatter_pub = n.advertise("test", 5);`. Someone has a hint for me?

Viewing latest article 13
Browse Latest Browse All 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>