# Switching between two robots; architecture

I am trying to control a robotic arm with a haptic input device using ROS. This works wonderfully. Next step is to switch control between two identical robotic arms using the same input device.

Currently I have three nodes: the input device wrapper, a conversion/translation node and the robot arm wrapper. There are the following topics:

• /inputdevice/state/Pose: this is the 'user input'
• /robot1/command/Pose: this is the setpoint for the robot
• /robot1/state/Pose: this is feedback about the robot pose, used in the conversion (the setpoint is relative to the start position).

Now I am adding another robot arm wrapper node, which adds the following topics:

• /robot2/command/Pose
• /robot2/state/Pose

I want to switch between robot1 and robot2 at the press of a button. What would be a suitable architecture to do this? I couldn't find anything for this case in patterns or best practices.

I have come up with the following solutions myself:

1. Have the conversion node provide a service that allows switching from publishing on the /robot1/ and /robot2/-topics. This might lead to complicated code (since I need to be careful not to carry state from one robot to the next), and might conflict with ROS topic remapping (my current way of controlling either robot1 or robot2).
2. Make an extra node that sits in between the converter and the robots, and reroutes signals based on some setting (probably a service as well). I think mux could do this. Again however, the converter contains state of the robot, so this should be kept somewhere and switched...
3. At the moment of switching tear down the converter node and start a new one with a different topic mapping. Is there a way to do this smoothly?
4. I could also combine 1 and 3, and have two converters running, both with a 'pause' service that can silence them.

Some of these solutions will definitely work, but I'm wondering what would be the typical approach following ROS philosophy.

Apologies if this is not the appropriate place for these kinds of general questions.

edit retag close merge delete