Subscriber Error
hi, i create a rosserial_python node with arduino which publish ultrasound data. and also, i create a node in my PC which subscribe to ultrasound data. but when i run rosrun to subscribe, i receive special characters.
can you help me please? i think that is convertion uint8_t to string but i don't know how can i do it.
UPDATE
#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;
}
Better if you could put the code and what you receive. Those "special" characters.
At first look could be that the field of the message where you want to put the ultrasound data doesnt have the same type as the data itself. For example in the msg file appears as string what in reality is an array.
You keep asking questions and then deleting them; even the ones that are answered. This is bad etiquette, and by constantly changing the question title you decrease the chance that someone will see and answer your question.
You've done this enough times and offended enough other users that I'm setting your account to moderated.
ok thank you