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

How can I get data in a callback function

asked 2012-09-28 13:52:44 -0500

dustsnow gravatar image

updated 2012-09-28 15:25:37 -0500

Kevin gravatar image

I have subscriber receive data from a topic. The message type is std_msgs::Bool. How can I access the data. I tried ".data" which didn't give me the content.

edit retag flag offensive close merge delete

Comments

1

Do you want to recieve data in a callback function? Then try bool var = msg->Data;

Peter Listov gravatar image Peter Listov  ( 2012-09-29 04:41:14 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
5

answered 2012-09-28 15:25:05 -0500

Kevin gravatar image

Why don't you look at the tutorials for subscribers and publishers? Also take a look at the bool message to figure it out.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-09-28 13:52:44 -0500

Seen: 1,068 times

Last updated: Sep 28 '12