Gazebo | Ignition | Community
Ask Your Question
0

Sensor Pose is wrong

asked 2013-07-16 09:03:23 -0600

Chris gravatar image

updated 2013-07-16 09:09:11 -0600

Hi,

I am having trouble with ray sensors and their pose in gazebo 1.4. The pose of links can be handled like I want them to behave. So I fixed my problem by using an extra link for each sensor until now.

 <link name="link_sensor1">
    <pose>0.0 0.0 0.51 0.0 0.0 0.0</pose>
    <sensor name="raysensor" type="ray">
     <always_on>true</always_on>
     <visualize>true</visualize>
     <ray>
      <!--...-->
     </ray>
    </sensor>
  </link>
  <link name="link_sensor2">
    <pose>0.0 0.0 0.51 0.0 -1.57 0.0 </pose>
    <sensor name="raysensor2" type="ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <ray>
       <!--...-->
      </ray>
    </sensor>
  </link>

Now I want to add all the sensors to one link, to have an easier control via joints (I don't want to add a seperate joint for each sensor)

The model:

<model name="box">
  <pose>0 0 0.5 0 0 0</pose>
  <static>false</static>
  <link name="link">
    <inertial>
      <mass>1.0</mass>
      <inertia>
        <ixx>1.0</ixx>
        <ixy>0.0</ixy>
        <ixz>0.0</ixz>
        <iyy>1.0</iyy>
        <iyz>0.0</iyz>
        <izz>1.0</izz>
      </inertia>
    </inertial>
    <collision name="collision">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
     </collision>
    <visual name="collision">
      <geometry>
        <box>
          <size>1 1 1</size>
        </box>
      </geometry>
    </visual>
  </link>
  <link name="link2">
    <sensor name="raysensor" type="ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <pose>0.0 0.0 0.51 0.0 0.0 0.0</pose>
      <ray>
        ...
      </ray>
    </sensor>
    <sensor name="raysensor2" type="ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <pose>0.0 0.0 0.51 0.0 -1.57 0.0 </pose>
      <ray>
       ...
      </ray>
    </sensor>
  </link>
  <joint name="my_joint" type="revolute">
    <parent>link</parent>
    <child>link2</child>
    <axis>
      <xyz>0 0 1</xyz>
    </axis>
  </joint>
</model>

In gazebo there is the following result: image description

I don't get any rotation done correctly... What am I doing wrong? Can anyone help me please...

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-07-16 12:16:24 -0600

iche033 gravatar image

yes there was a bug in laser visualization in gazebo 1.4 but the actual laser range values may be correct. If you installed from source, you can manually apply the patch. Alternatively, update to the latest revision of default branch.

edit flag offensive delete link more

Comments

Thanks for your answer. It helped partly. See my second post

Chris gravatar imageChris ( 2013-07-17 04:23:35 -0600 )edit
0

answered 2013-07-17 04:39:08 -0600

Chris gravatar image

updated 2013-07-17 10:05:36 -0600

I updated the the old version of the LaserVisual.cc

Now the problem changed: In my consideration the first transformation, is the pose of the model. So the new origin of the coordinate system should be in (0,0,0.5). The next transformation (pose of sensor) should shift the origin for the sensors and then rotate the axis in the right direction.... Am I wrong with this?

When a rotation is entered in the sensor pose something strange happens. The coordinate system is rotated first (-pi/2), then the translation of the model is done (+0.5 in z = -0.5 in x). THEN the translation of the sensor (0.51 in z) is realised in the initial coordinate system...

image description

In Addition: if I change the position of my model manually, the start point of the laser changes its position automatically:

image description

edit flag offensive delete link more

Comments

I just tried your model.sdf in gazbeo 1.8, and it seems to produce the correct result. See screenshot. It may have been a bug in the pose calculation in gazebo 1.4. Is updating gazebo an option for you?

iche033 gravatar imageiche033 ( 2013-07-18 12:30:20 -0600 )edit

Thank you. I fixed the problem with the gazebo update... actually I tried to avoid that

Chris gravatar imageChris ( 2013-07-19 07:34:16 -0600 )edit

Question Tools

Stats

Asked: 2013-07-16 09:03:23 -0600

Seen: 1,269 times

Last updated: Jul 17 '13