publish/subscribe arduino [closed]
hi, i want to subscribe in a node which publish 3 values from arduino. when i run: rostopic echo /servo, i receive my values, but when i run my node i receive others values. what can i do please? this is my code:
#include "ros/ros.h"
#include "std_msgs/Int8.h"
void angleCallback(const std_msgs::Int8& servo_msg)
{
ROS_INFO("I turn: [%i]", servo_msg);
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "angle_listener");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("/servo", 1000, angleCallback);
ros::spin();
return 0;
}
This is a duplicate of http://answers.ros.org/question/23097... . Please update that question instead of asking a new question. You can update your question by using the
edit
button.