Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

Collision links appear at absolute positions

Hi all,

When I spawn a custom table model somewhere in Gazebo, the table legs still appear around the absolute 0 position in a simulated laser scan (/base_laser). Why?

Running ROS Fuerte.

Gazebo gui, showing the relative position of the table:

Gazebo GUI screenshot

RViz Screenshot (notice the two table legs visible in laser scan; the other two are behind the robot) RViz screenshot

launch file:

<launch>
  <include file="$(find pr2_bringup_gazebo_demo)/launch/pr2_uncalibrated_empty_world.launch" />

  <param name="table_description" textfile="$(find race_gazebo_worlds)/models/race_table2.model" />
  <node name="spawn_table0" pkg="gazebo" type="spawn_model" args="-gazebo -param table_description -x -5.15 -y 3.56 -z 0.001 -Y 0.00 -model race_table0" respawn="false" output="screen" />
</launch>

model file (race_gazebo_worlds/models/race_table2.model):

<gazebo version="1.0">
<model name="race_table2" static="true">
  <link name="surface">
    <inertial mass="15.0">
      <inertia ixx="0.2134666666666667" ixy="0" ixz="0" iyy="0.2666666666666667" iyz="0" izz="0.053466666666666676"/>
    </inertial>

    <collision name="collision">
      <origin pose="0 0 0.69 0 0 0"/>
      <geometry>
        <box size="1.6 0.8 0.04"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="0 0 0.69 0 0 0"/>
      <geometry>
        <box size="1.6 0.8 0.04"/>
      </geometry>
      <material script="Gazebo/Wood"/>
    </visual>
  </link>

  <link name="front_left_leg">
    <collision name="collision">
      <origin pose="0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>

  <link name="front_right_leg">
    <collision name="collision">
      <origin pose="0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>

  <link name="back_right_leg">
    <collision name="collision">
      <origin pose="-0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="-0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>

  <link name="back_left_leg">
    <collision name="collision">
      <origin pose="-0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="-0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>
</model>
</gazebo>

Collision links appear at absolute positions

Hi all,

When I spawn a custom table model somewhere in Gazebo, the table legs still appear around the absolute 0 position in a simulated laser scan (/base_laser). Why?

Running ROS Fuerte.

Gazebo gui, showing the relative position of the table:

Gazebo GUI screenshot

RViz Screenshot (notice the two table legs visible in laser scan; the other two are behind the robot) RViz screenshot

launch file:

<launch>
  <include file="$(find pr2_bringup_gazebo_demo)/launch/pr2_uncalibrated_empty_world.launch" />

  <param name="table_description" name="table_description"
     textfile="$(find race_gazebo_worlds)/models/race_table2.model" />
  <node name="spawn_table0" pkg="gazebo" type="spawn_model" args="-gazebo args="-gazebo
     -param table_description -x -5.15 -y 3.56 -z 0.001 -Y 0.00 0.00
     -model race_table0" respawn="false" output="screen" />
</launch>

model file (race_gazebo_worlds/models/race_table2.model):

<gazebo version="1.0">
<model name="race_table2" static="true">
  <link name="surface">
    <inertial mass="15.0">
      <inertia ixx="0.2134666666666667" ixy="0" ixz="0" ixz="0"
               iyy="0.2666666666666667" iyz="0" iyz="0"
               izz="0.053466666666666676"/>
    </inertial>

    <collision name="collision">
      <origin pose="0 0 0.69 0 0 0"/>
      <geometry>
        <box size="1.6 0.8 0.04"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="0 0 0.69 0 0 0"/>
      <geometry>
        <box size="1.6 0.8 0.04"/>
      </geometry>
      <material script="Gazebo/Wood"/>
    </visual>
  </link>

  <link name="front_left_leg">
    <collision name="collision">
      <origin pose="0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>

  <link name="front_right_leg">
    <collision name="collision">
      <origin pose="0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>

  <link name="back_right_leg">
    <collision name="collision">
      <origin pose="-0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="-0.78 -0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>

  <link name="back_left_leg">
    <collision name="collision">
      <origin pose="-0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin pose="-0.78 0.38 0.34 0 0 0"/>
      <geometry>
        <cylinder radius="0.02" length="0.68"/>
      </geometry>
      <material script="Gazebo/Grey"/>
    </visual>
  </link>
</model>
</gazebo>