How do I use the same controller_manager yaml file to load controllers for diffferent robots with different names using group tags?

asked 2019-12-09 17:08:26 -0500

Patrick Musau gravatar image

I might be missing something. When you spawn multiple robots in simulation can you use the same yaml file to load a controller manager for each robot. Or do you need to have one yaml file per robot in order to load them correctly. I managed to spawn the robots independently using group tags but I wasn't sure what the correct way to load controller managers is. Thanks in advance for all your help.

edit retag flag offensive close merge delete

Comments

One way could be to use roslaunch substitution args in your .yaml file. See #q339328 for a recent Q&A about that.

Perhaps if you could provide somewhat of a more concrete example we could suggest better/other approaches.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-09 17:21:17 -0500 )edit

In theory if you add to your yaml the namespaces like this (correct me if I am mistaken):

ns_1:
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  
ns_2:
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  
ns_3:
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

you should be able to load the controllers config in each namespace. However this approach is more hardcoded than the one proposed by @gvdhoorn.

Weasfas gravatar image Weasfas  ( 2019-12-10 05:15:52 -0500 )edit