Ask Your Question
0

Unable to understand the usage of std_msgs/Empty.h

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

Edward Ramsay gravatar image

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

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
5

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

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
2

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 1,335 times

Last updated: Jul 12 '13