ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

publishing float values in rosserial

asked 2015-10-27 07:34:15 -0500

rosdino gravatar image

Hello everyone

I'm experimenting with rosserial. I tried to publish string values as given here, it works

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-27 23:02:03 -0500

stormswordx gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-10-27 07:34:15 -0500

Seen: 1,719 times

Last updated: Oct 27 '15