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

Unable to understand the usage of std_msgs/Empty.h

asked 2013-06-22 19:11:37 -0500

Edward Ramsay gravatar image

updated 2013-07-12 17:22:32 -0500

Does anybody understand what does the '--once' mean in 'rostopic pub toggle_led std_msgs/Empty'?

What should command should I put in the terminal to toggle the led of my choice. In my opinion, I think that '--once' is the cause of my failure.

Hope you guys can help me to solve this issue. THANKS!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-06-22 22:10:32 -0500

lindzey gravatar image

Check out

rostopic pub -h

For an explanation of --once. It doesn't do what you think it does.

Then, you might want to read the wiki documentation on msg, since it seems like you don't understand how you can use them. It might also help you to review the publisher/subscriber tutorial.

As for your question: std_msgs/Empty is just that - a message without any associated data. If you want to select which LED to blink, you'll want another message type that includes at least one data field.

edit flag offensive delete link more

answered 2013-06-23 17:32:12 -0500

Replace Empty with Bool and in the callback change led_state to toggle_msg. As lindzey said read up on the documentation.

edit flag offensive delete link more

Question Tools


Asked: 2013-06-22 19:11:37 -0500

Seen: 2,154 times

Last updated: Jul 12 '13