Robotics StackExchange | Archived questions

publishing float values in rosserial

Hello everyone

I'm experimenting with rosserial. I tried to publish string values as given here, it works http://wiki.ros.org/rosserial_arduino/Tutorials/Hello%20World

Similarly I'm looking to publish float values, can anyone give me an example how to do it?

Asked by rosdino on 2015-10-27 07:34:15 UTC

Comments

Answers

Instead of lines 11 & 12. You will need to instantiate the publisher with a different message data type.

std_msgs::Float64 myData;
ros::Publisher sendData("float_data", &myData);

These are some common message types I find myself using often.

Asked by stormswordx on 2015-10-27 23:02:03 UTC

Comments