Moveit "moveit_ros_move_group/move_group" nodes in a namespace

asked 2019-10-21 12:04:57 -0500

kky gravatar image

updated 2019-10-21 12:06:16 -0500

I am trying to have a multi-robot setup in Moveit for some time now. I followed the suggestions to create seperate move_group nodes and move on from there.

My question is how do I put a moveit_ros_move_group node inside a namespace?

My move_group.xml to run a single robot is something like this:

    <group ns="move_group_1">
        <include file="$(find my_robot)/launch/planning_pipeline.launch.xml">
            <arg name="pipeline" value="ompl" />
        </include>

        <!-- Trajectory Execution Functionality -->
        <include file="$(find my_robot_moveit)/launch/trajectory_execution.launch.xml" if="$(arg allow_trajectory_execution)">
            <arg name="moveit_manage_controllers" value="true" />
            <arg name="moveit_controller_manager" value="my_robot"/>
        </include>
    </group>

    <!-- Start the actual move_group node/action server -->
    <node name="move_group_1" pkg="moveit_ros_move_group" type="move_group" respawn="false" output="screen" args="$(arg command_args)">
        <!-- Set the display variable, in case OpenGL code is used internally -->
        <env name="DISPLAY" value="$(optenv DISPLAY :0)" />

        <param name="allow_trajectory_execution" value="$(arg allow_trajectory_execution)"/>
        <param name="max_safe_path_cost" value="$(arg max_safe_path_cost)"/>
        <param name="jiggle_fraction" value="$(arg jiggle_fraction)" />

        <!-- MoveGroup capabilities to load -->
        <param name="capabilities" value="move_group/MoveGroupCartesianPathService
            move_group/MoveGroupKinematicsService
            move_group/MoveGroupMoveAction
            move_group/MoveGroupPickPlaceAction
            move_group/MoveGroupPlanService
            move_group/MoveGroupQueryPlannersService
            move_group/MoveGroupStateValidationService
            move_group/MoveGroupGetPlanningSceneService
            move_group/ClearOctomapService
            " />

        <!-- Publish the planning scene of the physical robot so that rviz plugin can know actual robot -->
        <param name="planning_scene_monitor/publish_planning_scene" value="$(arg publish_monitored_planning_scene)" />
        <param name="planning_scene_monitor/publish_geometry_updates" value="$(arg publish_monitored_planning_scene)" />
        <param name="planning_scene_monitor/publish_state_updates" value="$(arg publish_monitored_planning_scene)" />
        <param name="planning_scene_monitor/publish_transforms_updates" value="$(arg publish_monitored_planning_scene)" />
    </node>

I tried to add a second move_group node without namespacing and it seems having two such nodes conflict with each other and it is not how it should be used.

Then, I wrapped this in a <group ns="ns1"> tag (with the intention of putting a 2nd robot later), but it gives a lot of errors (probably namespace related) and I can't figure out how to fix it. I think there is probably a clean way to do this.

Some of the errors are:

[INFO] Failed to call service get_planning_scene, have you launched move_group?
[ERROR] Action client not connected: left_robot/joint_trajectory_controller/follow_joint_trajectory
[ERROR] Unable to connect to move_group action server "move_group" within allotted time(30s)

If this is a completely wrong approach, I would be happy to know. In general, in its most basic form I am trying to have a basic setup in which multiple robots can execute their plans simultaneously (ignore the robot collisions please.)

edit retag flag offensive close merge delete

Comments

Hi kky! I am facing the same issue, trying to control simultaneously two UR3 for cooperative pick-and-place. Did you find a way to spawn two move_group nodes?

thibs-sigma gravatar image thibs-sigma  ( 2019-11-12 09:02:14 -0500 )edit

@thibs-sigma No and I don't think there is any way to call two move_group.execute() actually. What I did instead was copy the trajectory found by planning and send the points to the joint_trajectory_controller directly. It is not a perfect solution but at least I can get two robots moving at the same time.

kky gravatar image kky  ( 2019-11-12 10:15:47 -0500 )edit

@kky indeed, that does the trick! Many thanks for this suggestion. I really think too that spawning two move_group is not possible, at least with this version of ROS/MoveIt

thibs-sigma gravatar image thibs-sigma  ( 2019-11-12 11:44:48 -0500 )edit