Ask Your Question

Multiple sources of cmd_vel

asked 2012-06-12 13:44:17 -0500

Alex Brown gravatar image

I'm building a robot with multiple nodes which publish cmd_vel to perform different functions. Examples are joystick, nav stack, and a node which follows walls to perform mapping. What I would "like" is to have an executive node which controls which sources are publishing cmd_vel so that while I may have multiple source nodes running, in case I need them, only one is publishing at a time.
I suspect that I can't do this. How is this kind of problem handled in ROS?

edit retag flag offensive close merge delete


Yes, that will work. It just seems a little unesthetic from an efficiency point of view. My base controller node would have to subscribe to all possible sources of cmd_vel. Choosing between them would be easy, but it just seems messy to have all the unused messages running around. Maybe the inefficiency is negligible though. I haven't tried to measure it. Ultimately, I would like to be able to control the "unused" node sources so that they don't eat up throughput when I'm not using them. Perhaps it is possible to launch and close nodes programatically, but I haven't seen this anywhere. If it's not possible, it would be nice to have a control signal to each node that has been launched so that you could put it in a standby mode when it's cmd_vel output is not needed. Whoops, I missed Lorenz's ...(more)

Alex Brown gravatar image Alex Brown  ( 2012-06-13 15:51:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-06-12 14:11:50 -0500

The easiest way to solve your problem would be to publish cmd_vel on different topics, for instance


You can then write a node that takes in a list of topics, and publishes the appropriate topic on /cmd_vel.

edit flag offensive delete link more



One node that provides a service interfaces for selecting which topic should be re-published is

Lorenz gravatar image Lorenz  ( 2012-06-12 22:26:58 -0500 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2012-06-12 13:44:17 -0500

Seen: 509 times

Last updated: Jun 12 '12