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

laser_frame is pointing upwards

asked 2019-08-14 05:32:32 -0600

kallivalli gravatar image

updated 2019-08-14 05:36:48 -0600

hello everyone ,im very new to ros and found some issue with gmapping recently .my laser scanner is pointing upwards and couldnt able to do gmapping and i want to confirm whether my tf structure is working good or not

<robot
  name="archer">
  <link
    name="base_link">
    <inertial>
      <origin
        xyz="-0.0031521 -0.070703 0.33777"
        rpy="0 0 0" />
      <mass
        value="238.44" />
      <inertia
        ixx="39.449"
        ixy="-0.18466"
        ixz="-0.28812"
        iyy="16.942"
        iyz="-7.836"
        izz="29.425" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://archer_desctest/meshes/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.1098 0.1098 0.1098 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://archer_desctest/meshes/base_link.STL" />
      </geometry>
    </collision>
  </link>
  <link
    name="Wheel_1">
    <inertial>
      <origin
        xyz="0 6.9389E-18 0"
        rpy="0 0 0" />
      <mass
        value="1.232" />
      <inertia
        ixx="0.0033433"
        ixy="-8.6429E-19"
        ixz="-7.2476E-19"
        iyy="0.0033433"
        iyz="7.219E-19"
        izz="0.0062939" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://archer_desctest/meshes/Wheel_1.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.1098 0.1098 0.1098 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://archer_desctest/meshes/Wheel_1.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="RHS"
    type="continuous">
    <origin
      xyz="-0.2 0.075 -0.01"
      rpy="0 1.57 0" />
    <parent
      link="base_link" />
    <child
      link="Wheel_2" />
    <axis
      rpy="0 1 0"
      xyz="0 0 1" />
  </joint>
  <link
    name="Wheel_2">
    <inertial>
      <origin
        xyz="0 6.9389E-18 0"
        rpy="0 0 0" />
      <mass
        value="1.232" />
      <inertia
        ixx="0.0033433"
        ixy="-8.6429E-19"
        ixz="-7.2476E-19"
        iyy="0.0033433"
        iyz="7.219E-19"
        izz="0.0062939" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://archer_desctest/meshes/Wheel_2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.1098 0.1098 0.1098 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://archer_desctest/meshes/Wheel_2.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="LHS"
    type="continuous">
    <origin
      xyz="0.2 0.075 -0.01"
      rpy="0 1.57 0" />
    <parent
      link="base_link" />
    <child
      link="Wheel_1" />
    <axis
      rpy="0 1 0"
      xyz="0 0 1" />
  </joint>
  <link
    name="laser_frame">
    <inertial>
      <origin
        xyz="0.026431 -0.000309 0.0041422"
        rpy="0 0 0" />
      <mass
        value="0.32426" />
      <inertia
        ixx="0.00070878"
        ixy="-1.2652E-06"
        ixz="1.7595E-06"
        iyy="0.00067504"
        iyz="-1.6612E-05"
        izz="0.00056684" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-08-14 06:12:01 -0600

updated 2019-09-17 10:45:10 -0600

You're correct there is a small error in your URDF. The confusion is that there are two different coordinate frame conventions used for mobile robots and optical sensors, look at the suffix frames described in REP 103. Your lidar uses a frame where z points in the direction of the sensor, x is left and y is down. However your robot is defined using standard ROS conventions where z is up, and x faces in the same direction the robot is facing. You'll need to add a rotation to the definition of your laser_frame to correct this.

Update

You want to update the roll, pitch and yaw values provided in the following tag. I can't tell you which value without knowing more about the structure of your robot, but it will be adding or subtracting pi / 2 from one of those three values.

<joint
    name="lidar_mount"
    type="fixed">
    <origin
      xyz="0 -0.37929 0.64252"
      rpy=" 0.93993 -7.9855E-17 -3.1416" />
    <parent
      link="base_link" />
    <child
      link="laser_frame" />
    <axis
      xyz="0 0 0" />
  </joint>

Hope this helps.

edit flag offensive delete link more

Comments

can you tell where to add this in urdf file ?

kallivalli gravatar image kallivalli  ( 2019-09-17 09:57:24 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-08-14 05:32:32 -0600

Seen: 201 times

Last updated: Sep 17 '19