ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

instantiate two instances of moveit_commander

asked 2020-01-08 11:15:56 -0500

shu gravatar image

I am attempting to control two UR5 robots simultaneously but am running into an issue where I am able to create two move_group instances for each UR5 under different namespaces but the moveit_commander will only connect to the first move_group instance. Is it possible to either create an instance of moveit_commander for each robot or make the moveit_commander connect with both move_group instances?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-29 12:13:40 -0500

fvd gravatar image

updated 2020-03-02 04:32:09 -0500

You could run your robots in multiple separate move_groups, but I recommend defining them as separate planning groups inside a single move_group.

I don't see a problem with creating multiple moveGroupCommander instances to connect to different planning groups. Connecting a single moveit_commander to multiple move_groups is not the intended usage.

Note that you can create a third planning group that contains the joints of both arms, and control it with yet another moveGroupCommander instance. That would not connect it to both planning groups, but it would control the same robots. This is also how you can plan simultaneous motions with both arms.

edit flag offensive delete link more

Comments

Thanks, I never tried making more than one moveit_commander instance, though I'm a little confused as to how to do so. In the move group tutorial for kinetic, the initialization for the moveit_commander is moveit_commander.roscpp_initialize(sys.argv). So would I be able to create two instances of the moveit_commander inside the same class or will I need two different classes?

shu gravatar image shu  ( 2020-03-02 02:19:29 -0500 )edit

I clarified my answer, it was imprecise. I am actually not familiar with connecting to multiple move_group instances - what I recommend is to define your robots as planning groups inside a single move_group in the global namespace, and connect multiple moveGroupCommander objects to those planning groups. This works very well and ensures that each robot knows about the position of the other. If you have them in separate move groups, this is generally not the case.

This is not the prettiest example, but feel free to use it: https://github.com/o2as/ur-o2as/blob/...

fvd gravatar image fvd  ( 2020-03-02 04:31:26 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2020-01-08 11:15:56 -0500

Seen: 477 times

Last updated: Mar 02 '20