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?
Originally posted by Alex Brown on ROS Answers with karma: 176 on 2012-06-12
Post score: 0
Original comments
Comment by Alex Brown on 2012-06-13:
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 comment just off my screen. That is what I could include in my "executive" node that I refer to. It does add more latency to the signal though. I'll probably do something like this though.