Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

strange pitch direction

Hello! I have some troubles understanding rpy. Here is my simple URDF file:

<robot name="test">
<link name="Body">
  <inertial>
    <mass value="4.0" />
    <origin xyz="1 0 0"/>
    <inertia ixx="1" ixy="1" ixz="1" iyy="1" iyz="1" izz="1" />
  </inertial>
  <visual>
    <geometry>
      <box size="0.1 0.02 0.02"/>
    </geometry>

  </visual>
</link>


<link name="link1">
  <inertial>
    <mass value="4.0" />
    <origin xyz="1 0 0"/>
    <inertia ixx="1" ixy="1" ixz="1" iyy="1" iyz="1" izz="1" />
  </inertial>
  <visual>
    <geometry>
      <box size="0.1 0.02 0.02"/>
    </geometry>

  </visual>

</link>


<joint name="j1" type="revolute" >
  <parent link="Body"/>
  <child link="link1"/>
  <origin xyz="0.1 0 0" rpy="0 -0.5 0" />
  <axis xyz="1 0 0"/>
  <limit lower="-1.57" upper="1.57" effort="10" velocity="10"/>
</joint>

<!--
<link name="link2">
  <inertial> <mass value="5.0" />
  <origin xyz="1 0 0"/>
  </inertial>
</link>

<link name="link3">
  <inertial> <mass value="5.0" />
  <origin xyz="1 0 0"/>
  </inertial>
</link>

    <joint name="j2" type="revolute" >
    <parent link="Body"/>
    <child link="link2"/>
    <origin xyz="1 0 2" rpy="0 0 0" />
    <axis xyz="1 0 0"/>

  </joint>
  <joint name="j3" type="revolute" >
    <parent link="Body"/>
    <child link="link2"/>
    <origin xyz="1 0 1" rpy="0 0 0" />
    <axis xyz="1 0 0"/>

  </joint>
-->

</robot>

As you see, there are two links with a revolute joint between them. There is a pitch of -0.5 radians in the joint. And here is the rviz image :

image description

The question is why link1 is rotated upwards instead of downwards?

strange pitch direction

Hello! I have some troubles understanding rpy. Here is my simple URDF file:

<robot name="test">
<link name="Body">
  <inertial>
    <mass value="4.0" />
    <origin xyz="1 0 0"/>
    <inertia ixx="1" ixy="1" ixz="1" iyy="1" iyz="1" izz="1" />
  </inertial>
  <visual>
    <geometry>
      <box size="0.1 0.02 0.02"/>
    </geometry>

  </visual>
</link>


<link name="link1">
  <inertial>
    <mass value="4.0" />
    <origin xyz="1 0 0"/>
    <inertia ixx="1" ixy="1" ixz="1" iyy="1" iyz="1" izz="1" />
  </inertial>
  <visual>
    <geometry>
      <box size="0.1 0.02 0.02"/>
    </geometry>

  </visual>

</link>


<joint name="j1" type="revolute" >
  <parent link="Body"/>
  <child link="link1"/>
  <origin xyz="0.1 0 0" rpy="0 -0.5 0" />
  <axis xyz="1 0 0"/>
  <limit lower="-1.57" upper="1.57" effort="10" velocity="10"/>
</joint>

<!--
<link name="link2">
  <inertial> <mass value="5.0" />
  <origin xyz="1 0 0"/>
  </inertial>
</link>

<link name="link3">
  <inertial> <mass value="5.0" />
  <origin xyz="1 0 0"/>
  </inertial>
</link>

    <joint name="j2" type="revolute" >
    <parent link="Body"/>
    <child link="link2"/>
    <origin xyz="1 0 2" rpy="0 0 0" />
    <axis xyz="1 0 0"/>

  </joint>
  <joint name="j3" type="revolute" >
    <parent link="Body"/>
    <child link="link2"/>
    <origin xyz="1 0 1" rpy="0 0 0" />
    <axis xyz="1 0 0"/>

  </joint>
-->

</robot>

As you see, there are two links with a revolute joint between them. There is a pitch of -0.5 radians in the joint. And here is the rviz image :

image description

The question is why link1 is rotated upwards instead of downwards?