Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

Robot joint detaches when simulation is loaded

I'm trying to simulate a simple 4 DOF robot using gazebo. The robot has 3 revolute joints and 1 prismatic joint. The link named "wall_link" is fixed to the world. I've created the MYROBOT_description and MYROBOT_gazebo packages using the following tutorial.

However, when I run the simulation the prismatic and the first revolute joints simply detach from the fixed link and float away. No warnings or errors pop up when the simulation launch file is loaded (snippets of the launch file in the terminal and the code are attached). Here are the fixes that I have tried until this point (none of these have worked):

  1. Rechecked whether the inertial tag in each link is defined and accurate
  2. Checked the joints and whether the child / parent links are properly defined
  3. Tried adding a self_collide tag for the links to see if that fixes it

Can someone please help me out with this?

Terminal output when launch file is run

image description

Before Running (while paused)

image description

After Running (after unpausing)

image description

The URDF file is as follows:

<?xml version="1.0" encoding="utf-8"?>

<robot name="r3">

<link name="world"/>

<joint name="fixed" type="fixed"> <parent link="world"/> <child link="wall_link"/> </joint>

<link name="wall_link">

<inertial>
  <origin
    xyz="-1.3668E-17 0.3 0.00020351"
    rpy="0 0 0" />
  <mass
    value="18.067" />
  <inertia
    ixx="0.5559"
    ixy="-4.6489E-21"
    ixz="-4.3369E-18"
    iyy="0.15"
    iyz="7.5132E-22"
    izz="0.6759" />
</inertial>

<visual>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/wall_link.STL" />
  </geometry>
  <material
    name="">
    <color
      rgba="1 1 1 1" />
  </material>
</visual>

<collision>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/wall_link.STL" />
  </geometry>
</collision>

</link>

<link name="linear_rail">

<inertial>
  <origin
    xyz="-4.1743E-15 0.0085192 -0.016"
    rpy="0 0 0" />
  <mass
    value="0.011057" />
  <inertia
    ixx="1.4641E-06"
    ixy="5.4276E-21"
    ixz="4.8907E-22"
    iyy="3.7337E-06"
    iyz="-2.9124E-22"
    izz="3.7228E-06" />
</inertial>

<visual>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/linear_rail.STL" />
  </geometry>
  <material
    name="">
    <color
      rgba="0.75294 0.75294 0.75294 1" />
  </material>
</visual>

<collision>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/linear_rail.STL" />
  </geometry>
</collision>

</link>

<joint name="rail_joint" type="prismatic"> <origin xyz="0 -0.066 0.284" rpy="3.1416 0 0"/> <parent link="wall_link"/> <child link="linear_rail"/> <axis xyz="0 0 -1"/> <limit lower="-0.2" upper="0.2" effort="10" velocity="5"/> </joint>

<link name="thigh_link">

<inertial>
  <origin
    xyz="9.8897E-05 -0.072814 0.00035302"
    rpy="0 0 0" />
  <mass
    value="0.18426" />
  <inertia
    ixx="0.00011096"
    ixy="-2.6884E-10"
    ixz="8.301E-14"
    iyy="4.5179E-05"
    iyz="-1.6755E-07"
    izz="9.3875E-05" />
</inertial>

<visual>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/thigh_link.STL" />
  </geometry>
  <material
    name="">
    <color
      rgba="0.79216 0.81961 0.93333 1" />
  </material>
</visual>

<collision>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/thigh_link.STL" />
  </geometry>
</collision>

</link>

<joint name="thigh_joint" type="revolute"> <origin xyz="0 0.037 -0.016" rpy="0 -1.5708 -3.1415"/> <parent link="linear_rail"/> <child link="thigh_link"/> <axis xyz="0 0 1"/> <limit lower="-1.5708" upper="1.5708" effort="8" velocity="4"/> </joint>

<link name="shank_link">

<inertial>
  <origin
    xyz="9.8897E-05 -0.072814 0.00035302"
    rpy="0 0 0" />
  <mass
    value="0.18426" />
  <inertia
    ixx="0.00011096"
    ixy="-2.6884E-10"
    ixz="8.301E-14"
    iyy="4.5179E-05"
    iyz="-1.6755E-07"
    izz="9.3875E-05" />
</inertial>

<visual>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/shank_link.STL" />
  </geometry>
  <material
    name="">
    <color
      rgba="0.79216 0.81961 0.93333 1" />
  </material>
</visual>

<collision>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/shank_link.STL" />
  </geometry>
</collision>

</link>

<joint name="shank_joint" type="revolute"> <origin xyz="0.00025 -0.23475 0" rpy="0 0 0"/> <parent link="thigh_link"/> <child link="shank_link"/> <axis xyz="0 0 1"/> <limit lower="-2.09" upper="2.09" effort="8" velocity="4"/> </joint>

<link name="toe_link">

<inertial>
  <origin
    xyz="8.7264E-05 -0.027482 0.00044851"
    rpy="0 0 0" />
  <mass
    value="0.13019" />
  <inertia
    ixx="6.1131E-05"
    ixy="-5.1058E-10"
    ixz="8.301E-14"
    iyy="4.0965E-05"
    iyz="-1.6755E-07"
    izz="4.3864E-05" />
</inertial>

<visual>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/toe_link.STL" />
  </geometry>
  <material
    name="">
    <color
      rgba="0.79216 0.81961 0.93333 1" />
  </material>
</visual>

<collision>
  <origin
    xyz="0 0 0"
    rpy="0 0 0" />
  <geometry>
    <mesh
      filename="package://r3_description/meshes/toe_link.STL" />
  </geometry>
</collision>

</link>

<joint name="toe_joint" type="revolute"> <origin xyz="0.00025 -0.23475 0" rpy="0 0 0"/> <parent link="shank_link"/> <child link="toe_link"/> <axis xyz="0 0 1"/> <limit lower="-2.09" upper="2.09" effort="8" velocity="4"/> </joint>

<gazebo reference="wall_link"> <self_collide>1</self_collide> </gazebo> <gazebo reference="linear_rail_link"> <self_collide>1</self_collide> </gazebo> <gazebo reference="thigh_link"> <self_collide>1</self_collide> </gazebo> <gazebo reference="shank_link"> <self_collide>1</self_collide> </gazebo> <gazebo reference="toe_link"> <self_collide>1</self_collide> </gazebo>

<!-- Rail Joint Transmission -->
<transmission name="trans_rail_joint">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="rail_joint">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="rail_joint_motor">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<!-- Thigh Joint Transmission -->
<transmission name="trans_thigh_joint">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="thigh_joint">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="thigh_joint_motor">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<!-- Shank Joint Transmission -->
<transmission name="trans_shank_joint">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="shank_joint">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="shank_joint_motor">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<!-- Toe Joint Transmission -->
<transmission name="trans_toe_joint">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="toe_joint">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="toe_joint_motor">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

<!-- Plugins -->

<!-- Gazebo ROS Control Plugin -->
<gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/r3</robotNamespace>
    <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
</gazebo>

</robot>