ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

robot is not algined to the laser scanner frame

asked 2014-09-02 07:54:41 -0500

sumanth gravatar image

updated 2014-09-03 00:40:09 -0500

I have my own URDF file, when I try to do mapping using the slam_gmapping node, then open the rviz with the map and robot model, then I can see that what the actual laser scanner is seeing is exactly 90 degree offset to how the lase scanner is oriented in the simulation.

for more details please go through the screen shot attached: image description

Please find my URDF here. :

<robot name="my_robot">

  <link name="base_link">
    <visual>
      <geometry>
        <box size="0.6 0.35 0.15"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <material name="white">
        <color rgba="0.2 1 0.3 1"/>
      </material>
    </visual>
  </link>

 <link name="lwheel">
    <visual>
      <geometry>
        <cylinder length="0.04" radius="0.1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
  </link>

  <joint name="base_to_lwheel" type="fixed">
    <parent link="base_link"/>
    <child link="lwheel"/>
    <origin xyz="-0.1 -0.2 -0.025" rpy="1.5708 0 0"/>
    <axis xyz="-0.1 -0.2 -0.025 " />
  </joint>

 <link name="rwheel">
    <visual>
      <geometry>
        <cylinder length="0.04" radius="0.1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
  </link>

  <joint name="base_to_rwheel" type="fixed">
    <parent link="base_link"/>
    <child link="rwheel"/>
    <origin xyz="-0.1 0.2 -0.025" rpy="-1.5708 0 0"/>
  </joint>

  <link name="fwheel_left">
    <visual>
      <geometry>
        <cylinder length="0.05" radius="0.03"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
  </link>

  <joint name="base_to_fwheel_left" type="fixed">
    <parent link="base_link"/>
    <child link="fwheel_left"/>
    <origin xyz="0.22 -0.1 -0.095" rpy="1.5708 0 0"/>
  </joint>

  <link name="fwheel_right">
    <visual>
      <geometry>
        <cylinder length="0.05" radius="0.03"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
  </link>

  <joint name="base_to_fwheel_right" type="fixed">
    <parent link="base_link"/>
    <child link="fwheel_right"/>
    <origin xyz="0.22 0.1 -0.095" rpy="-1.5708 0 0"/>
  </joint>

   <link name="camera_link">
    <visual>
      <geometry>
        <box size="0.28 0.065 0.04"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="0 0 0 1"/>
      </material>
    </visual>
  </link>

   <link name="scan_support">
    <visual>
      <geometry>
        <cylinder length="0.36" radius="0.015"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <material name="black">
        <color rgba="1 0.2 0.1 1"/>
      </material>
    </visual>
  </link>

  <joint name="base_to_scan_support" type="fixed">
    <parent link="base_link"/>
    <child link="scan_support"/>
    <origin xyz="0.10 0 0.255" rpy="0 0 0"/>
 </joint>

  <joint name="base_to_scanner" type="fixed">
    <parent link="base_link"/>
    <child link="camera_link"/>
    <origin xyz="0.10 0 0.455" rpy="0 0 -1.5708"/>
 </joint>

</robot>

Any insights for what might be wrong here..?

Many thanks in advance.

edit retag flag offensive close merge delete

Comments

What is the Reference Frame in "Grid"?

anamcarvalho gravatar image anamcarvalho  ( 2014-09-02 08:24:07 -0500 )edit

The reference frame in grid was <fixed frame="">

sumanth gravatar image sumanth  ( 2014-09-02 08:36:34 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-09-02 20:21:22 -0500

updated 2014-09-03 01:17:55 -0500

I woud rotate the link between the laser and your robot's body 90 degrees on your URDF.

[UPDATE]

Yup... you have to rotate the link between the laser and the robot body by 90 degrees. See the following image:

image description

The red line (x direction) of the camera_link is pointing to the right side of the robot. It should be pointing to the front!

Try changing this in your URDF

...


<link name="camera_link">
  <visual>
    <geometry>
      <box size="0.065 0.28 0.04"/>
    </geometry>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <material name="black">
      <color rgba="0 0 0 1"/>
    </material>
  </visual>
</link>

...

<joint name="base_to_scanner" type="fixed">
  <parent link="base_link"/>
  <child link="camera_link"/>
  <origin xyz="0.10 0 0.455" rpy="0 0 0"/>
</joint>
edit flag offensive delete link more

Comments

But ideally this should be done..?

sumanth gravatar image sumanth  ( 2014-09-03 00:01:08 -0500 )edit

Well, according to your screen shot the fixed frame is set to map and all the other frames seem to be correct. To me that suggests that there is a mistake on the URDF link tree. Could you post the URDF file?

Martin Peris gravatar image Martin Peris  ( 2014-09-03 00:36:08 -0500 )edit

martin, I have modified the question with the URDF, can you please re-visit the question again.

sumanth gravatar image sumanth  ( 2014-09-03 00:40:50 -0500 )edit

sumanth, I think I've found your problem. Please see the updated answer for the solution

Martin Peris gravatar image Martin Peris  ( 2014-09-03 01:32:35 -0500 )edit

Martin, Many thanks super help, I have over looked the coordinate frame of my scanner. thanks

sumanth gravatar image sumanth  ( 2014-09-03 01:47:06 -0500 )edit
0

answered 2014-09-02 10:01:46 -0500

anamcarvalho gravatar image

You have to define a Reference Frame in Grid... It might solve your problem if you choose "laser" as a reference frame!

edit flag offensive delete link more

Comments

No I have changed the Reference frame in Grid to my scanner frame, but still the observation is same

sumanth gravatar image sumanth  ( 2014-09-02 10:25:35 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-02 07:54:41 -0500

Seen: 535 times

Last updated: Sep 03 '14