ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You are missing a header file.
For the callback, in the tutorial there is a line containing
#include "std_msgs/String.h"
You should replace that with
#include "std_msgs/UInt16.h"
For the publisher you will want to replace the line containing
ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);
with
ros::Publisher chatter_pub = n.advertise<std_msgs::UInt16>("chatter", 1000);