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

Revision history [back]

click to hide/show revision 1
initial version

As mentioned in the comments, URDF doesn't support contributions of multiple joints to a single joint.

However, I was able to model the behavior (in a Dobot Magician) by placing multiple joints "on top of each other". I did this by placing a virtual link (has a 0 length) between 2 joints. From a visual perspective It will appear that a single joint on your arm is moving but the 2 joint frames will visible and in effect be additive since the joint is at the same location. For example:

<joint name="joint_rotator_to_reararm" type="revolute"> <parent link="link_rotator"/> <child link="link_reararm"/> <origin rpy="0 0 0" xyz="0 0 0.082"/> <axis xyz="0 1 0"/> <limit effort="20" lower="-0.0872663888889" upper="1.570795" velocity="1"/> </joint> <link name="link_reararm"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.dae"/> </geometry> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.stl"/> </geometry> </collision> </link> <joint name="joint_reararm_to_reararm_virtual" type="revolute"> <parent link="link_reararm"/> <child link="link_reararm_virtual"/> <mimic joint="joint_rotator_to_reararm" multiplier="-1" offset="0"/> <origin rpy="0 0 0" xyz="0 0 0.135"/> <axis xyz="0 1 0"/> <limit effort="20" lower="0" upper="0" velocity="1"/> </joint> <link name="link_reararm_virtual"> </link> <joint name="joint_reararm_virtual_to_forearm" type="revolute"> <parent link="link_reararm_virtual"/> <child link="link_forearm"/> <origin rpy="0 0 0" xyz="0 0 0"/> <axis xyz="0 1 0"/> <limit effort="20" lower="-0.261799166667" upper="1.570795" velocity="1"/> </joint> <link name="link_forearm"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.dae"/> </geometry> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.stl"/> </geometry> </collision> </link>

So I'd think you could just place multiple mimic joints on top of each other to include their contribution to the movement of any particular joint.

This works great if you're just playing with the simple joint position sliders in Rviz as you can get accurate movement for the robot. I was able to model the Magician this way. However, when you try to use that model with moveit it falls apart because the default KDL solver doesn't support mimic joints. As I'm new to ROS I'm in the dark as to support for mimic joints with moveit and the available IK space. At least I've not found any way to use mimic joints in moveit and my searching foo has found nothing so far. I'm also unsure if multiple joints on top of each other is even valid. That being said I don't know that this solution serves any long term goals you might have in ROS.

As mentioned in the comments, URDF doesn't support contributions of multiple joints to a single joint.

However, I was able to model the behavior (in a Dobot Magician) by placing multiple joints "on top of each other". I did this by placing a virtual link (has a 0 length) between 2 joints. From a visual perspective It will appear that a single joint on your arm is moving but the 2 joint frames will visible and in effect be additive since the joint is at the same location. For example:

<joint name="joint_rotator_to_reararm" type="revolute"> <parent link="link_rotator"/> <child link="link_reararm"/> <origin rpy="0 0 0" xyz="0 0 0.082"/> <axis xyz="0 1 0"/> <limit effort="20" lower="-0.0872663888889" upper="1.570795" velocity="1"/> </joint> <link name="link_reararm"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.dae"/> </geometry> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.stl"/> </geometry> </collision> </link> <joint name="joint_reararm_to_reararm_virtual" type="revolute"> <parent link="link_reararm"/> <child link="link_reararm_virtual"/> <mimic joint="joint_rotator_to_reararm" multiplier="-1" offset="0"/> <origin rpy="0 0 0" xyz="0 0 0.135"/> <axis xyz="0 1 0"/> <limit effort="20" lower="0" upper="0" velocity="1"/> </joint> <link name="link_reararm_virtual"> </link> <joint name="joint_reararm_virtual_to_forearm" type="revolute"> <parent link="link_reararm_virtual"/> <child link="link_forearm"/> <origin rpy="0 0 0" xyz="0 0 0"/> <axis xyz="0 1 0"/> <limit effort="20" lower="-0.261799166667" upper="1.570795" velocity="1"/> </joint> <link name="link_forearm"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.dae"/> </geometry> </visual> <collision> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://xxx.stl"/> </geometry> </collision> </link>

So I'd think you could just place multiple mimic joints on top of each other to include their contribution to the movement of any particular joint.

This works great if you're just playing with the simple joint position sliders in Rviz as you can get accurate movement for the robot. I was able to model the Magician this way. However, when you try to use that model with moveit it falls apart because the default KDL solver doesn't support mimic joints. As I'm new to ROS I'm in the dark as to support for mimic joints with moveit and the available IK space. At least I've not found any way to use mimic joints in moveit and my searching foo has found nothing so far. I'm also unsure if multiple joints on top of each other is even valid. That being said I don't know that this solution serves any long term goals you might have in ROS.

As mentioned in the comments, URDF doesn't support contributions of multiple joints to a single joint.

However, I was able to model the behavior (in a Dobot Magician) by placing multiple joints "on top of each other". I did this by placing a virtual link (has a 0 length) between 2 joints. From a visual perspective It will appear that a single joint on your arm is moving but the 2 joint frames will visible and in effect be additive since the joint is at the same location. For example:

<joint name="joint_rotator_to_reararm" type="revolute">
   <parent link="link_rotator"/>
    link="link_rotator" />
  <child link="link_reararm"/>
      <origin rpy="0 0 0" xyz="0 0 0.082"/>
    link="link_reararm" />
  <origin rpy="0 0 0" xyz="0 0 0.082" />
  <axis xyz="0 1 0"/>
    0" />
  <limit effort="20" lower="-0.0872663888889" upper="1.570795" velocity="1"/>
    velocity="1" />
</joint>
 <link name="link_reararm">
   <visual>
        <origin rpy="0 0 0" xyz="0 0 0"/>
    <origin rpy="0 0 0" xyz="0 0 0" />
    <geometry>
       <mesh filename="package://xxx.dae"/>
    filename="package://xxx.dae" />
    </geometry>
   </visual>
   <collision>
        <origin rpy="0 0 0" xyz="0 0 0"/>
    <origin rpy="0 0 0" xyz="0 0 0" />
    <geometry>
       <mesh filename="package://xxx.stl"/>
    filename="package://xxx.stl" />
    </geometry>
   </collision>
 </link>
 <joint name="joint_reararm_to_reararm_virtual" type="revolute">
   <parent link="link_reararm"/>
    link="link_reararm" />
  <child link="link_reararm_virtual"/>
    link="link_reararm_virtual" />
  <mimic joint="joint_rotator_to_reararm" multiplier="-1" offset="0"/>
      <origin rpy="0 0 0" xyz="0 0 0.135"/>
    offset="0" />
  <origin rpy="0 0 0" xyz="0 0 0.135" />
  <axis xyz="0 1 0"/>
    0" />
  <limit effort="20" lower="0" upper="0" velocity="1"/>
    velocity="1" />
</joint>
 <link name="link_reararm_virtual">
 </link>
 <joint name="joint_reararm_virtual_to_forearm" type="revolute">
   <parent link="link_reararm_virtual"/>
    link="link_reararm_virtual" />
  <child link="link_forearm"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    link="link_forearm" />
  <origin rpy="0 0 0" xyz="0 0 0" />
  <axis xyz="0 1 0"/>
    0" />
  <limit effort="20" lower="-0.261799166667" upper="1.570795" velocity="1"/>
    velocity="1" />
</joint>
 <link name="link_forearm">
   <visual>
        <origin rpy="0 0 0" xyz="0 0 0"/>
    <origin rpy="0 0 0" xyz="0 0 0" />
    <geometry>
       <mesh filename="package://xxx.dae"/>
    filename="package://xxx.dae" />
    </geometry>
   </visual>
   <collision>
        <origin rpy="0 0 0" xyz="0 0 0"/>
    <origin rpy="0 0 0" xyz="0 0 0" />
    <geometry>
       <mesh filename="package://xxx.stl"/>
    filename="package://xxx.stl" />
    </geometry>
   </collision>
    </link>

</link>

So I'd think you could just place multiple mimic joints on top of each other to include their contribution to the movement of any particular joint.

This works great if you're just playing with the simple joint position sliders in Rviz as you can get accurate movement for the robot. I was able to model the Magician this way. However, when you try to use that model with moveit it falls apart because the default KDL solver doesn't support mimic joints. As I'm new to ROS I'm in the dark as to support for mimic joints with moveit and the available IK space. At least I've not found any way to use mimic joints in moveit and my searching foo has found nothing so far. I'm also unsure if multiple joints on top of each other is even valid. That being said I don't know that this solution serves any long term goals you might have in ROS.