ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
It would be something like this:
#include <std_msgs/Int8.h>
msg.data = 17;
ROS_INFO("%d", msg.data);
chatter_pub.publish(msg);
2 | add msg declaration |
It would be something like this:
#include <std_msgs/Int8.h>
std_msgs::Int8 msg;
msg.data = 17;
ROS_INFO("%d", msg.data);
chatter_pub.publish(msg);