gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 476 forks source link

Default joint axis (ODE) #2326

Open osrf-migration opened 7 years ago

osrf-migration commented 7 years ago

Original report (archived issue) by Peter Horak (Bitbucket: pchorak).


The default joint axis is incorrect for ODE. The sdformat specifies the z-axis (0, 0, 1) as the default here . The other physics engines are consistent with this and use the z-axis. However, ODE appears to use the x-axis as the default. This also creates an inconsistency with the visual, which shows the z-axis even though the simulation behaves as if the x-axis is the joint axis.

A few related observations:

  1. The online sdf specification does not show the default values for many elements including the joint axis.

  2. The universal joint requires the two axes to be perpendicular. Specifying non-perpendicular axes causes different behavior depending on the physics engine used.

osrf-migration commented 7 years ago

Original comment by Peter Horak (Bitbucket: pchorak).


Example:

axis_default.gif

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <include>
      <uri>model://sun</uri>
    </include>
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <model name="model1">
      <pose>-2 -2 1.5 0 0 0</pose>
      <link name="link">
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </visual>
      </link>
      <joint name="joint" type="revolute">
        <pose>0 -0.5 -0.5 0 0 0</pose>
        <parent>world</parent>
        <child>link</child>
      </joint>
    </model>
    <model name="model2">
      <pose>0 0 1.5 0 0 0</pose>
      <link name="link">
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </visual>
      </link>
      <joint name="joint" type="universal">
        <pose>0 -0.5 -0.5 0 0 0</pose>
        <parent>world</parent>
        <child>link</child>
        <axis>
          <xyz>1 1 0</xyz>
        </axis>
      </joint>
    </model>
    <model name="model3">
      <pose>2 2 1.5 0 0 0</pose>
      <link name="link">
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </visual>
      </link>
      <joint name="joint" type="prismatic">
        <pose>0 -0.5 -0.5 0 0 0</pose>
        <parent>world</parent>
        <child>link</child>
      </joint>
    </model>
  </world>
</sdf>