how to build a dual_arm system in Gazebo and MoveIt?

asked 2019-07-04 22:16:21 -0500

FORGRESS gravatar image

updated 2019-07-05 10:59:14 -0500

jayess gravatar image

enter code here I tried to build a dual-arm system by iiwa. I downloaded code on Github, the name of package is: "iiwa_stack". Then, I wrote a xacro file to include the model of iiwa7 twice. And named them as "iiwa_Left" and "iiwa_Right" There is my xacro file:

<?xml version="1.0"?>
<robot name="dual_iiwa" xmlns:xacro="">
  <!-- Import Rviz colors -->
  <xacro:include filename="$(find iiwa_description)/urdf/materials.xacro" />
  <!--Import the lbr iiwa macro -->
  <xacro:include filename="$(find iiwa_description)/urdf/iiwa7.xacro"/>

  <!--<xacro:include filename="$(find iiwa_description)/urdf/iiwa.gazebo.xacro"/>-->

  <xacro:arg name="hardware_interface" default="PositionJointInterface"/>
  <!--Right arm-->
  <xacro:arg name="robotL_name" default="iiwaLeft"/>
  <xacro:arg name="originL_xyz" default="0 0.5 0.5"/>
  <xacro:arg name="originL_rpy" default="-1.57 0 0"/>
  <!--Left arm-->
  <xacro:arg name="robotR_name" default="iiwaRight"/>
  <xacro:arg name="originR_xyz" default="0 -0.5 0.5"/>
  <xacro:arg name="originR_rpy" default="1.57 0 0"/>

  <!-- Fix to world just for testing -->
  <link name="world"/>

  <!--Robot Body Link-->
  <link name="body_link">
      <origin xyz="0 0 0.5" rpy="0 0 0" />
      <mass value="1" />
      <inertia ixx="0.05" ixy="0" ixz="0" iyy="0.05" iyz="0" izz="0.03" />
      <origin xyz="0 0 0.5" rpy="0 0 0" />
        <box size="1 1 1" />
      <material name="white">
        <color rgba="1 1 1 1"/>
      <origin xyz="0 0 0.5" rpy="0 0 0" />
        <box size="1 1 1" />

  <gazebo reference="body_link">

  <joint name="body_joint" type="fixed">
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <parent link="world"/>
      <child link="body_link"/>

  <xacro:iiwa7 hardware_interface="$(arg hardware_interface)" robot_name="$(arg robotL_name)" parent="body_link">
    <origin xyz="$(arg originL_xyz)" rpy="$(arg originL_rpy)" />

  <xacro:iiwa7 hardware_interface="$(arg hardware_interface)" robot_name="$(arg robotR_name)" parent="body_link">
    <origin xyz="$(arg originR_xyz)" rpy="$(arg originR_rpy)" />


Then, I wrote a new gazebo.launch file. You can see that, left and right arm use different control.launch file in different namespace. I think two arms should in different namespace. The file dual_iiwa_world.launch is same to the origin file "iiwa_world.launch", I just changed the model file. There is my gazebo.launch file.

<?xml version="1.0"?>

    <arg name="hardware_interface" default="PositionJointInterface" />
    <arg name="robotL_name" default="iiwaLeft" />
    <arg name="robotR_name" default="iiwaRight" />
    <arg name="model" default="dual_iiwa"/>
    <arg name="trajectory" default="true"/>

    <!-- Loads the Gazebo world. -->
    <include file="$(find iiwa_gazebo)/launch/dual_iiwa_world.launch">
        <arg name="hardware_interface" value="$(arg hardware_interface)" />
        <arg name="model" value="$(arg model)" />
    < ...
edit retag flag offensive close merge delete


Did you solve this in the meantime? I would suggest using a single move_group with the two robots, and starting up only the robots in their own namespaces.

fvd gravatar image fvd  ( 2020-03-02 23:42:47 -0500 )edit