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

IMU plugin has strange measurements in RViz

asked 2019-07-15 02:59:14 -0600

dofrey gravatar image

updated 2019-07-15 03:34:35 -0600

My robot has an IMU attached to its arm. The following URDF xacro macro is defining the IMU:

<xacro:macro name="xsens_imu" params="prefix parent xyz rpy simulation:=false">

    <material name="xsens-orange">
        <color rgba="0.8862745098 0.56862745098 0.09019607843 1"/>

    <joint name="${parent}_to_xsens_imu" type="fixed">
        <parent link="${parent}"/>
        <child link="xsens_imu"/>
        <origin xyz="${xyz}" rpy="${rpy}"/>

    <link name="xsens_imu">
            <origin rpy="0 0 0" xyz="0 0 0"/>
                <box size="0.057 0.041 0.024"/> <!--a simple box is used with the outer dimensions for simplicity-->
            <material name="xsens-orange"/>
            <origin rpy="0 0 0" xyz="0 0 0"/>
                <box size="0.057 0.041 0.024"/>
            <mass value="0.055"/>
            <origin xyz="0 0 0"/>
            <inertia ixx="1.60333333333e-05" ixy="0.0" ixz="0.0" iyy="2.80333333333e-05" iyz="0.0"

    <xacro:if value="${simulation}">
            <plugin name="imu_controller" filename="">
                <xyzOffsets>0 0 0</xyzOffsets>
                <rpyOffsets>0 0 0</rpyOffsets>

But when I attach it to my robot, the outputs of the IMU are wrong. The resulting direction of the linear acceleration does not make sense to me. As the robot is stationary in this moment, I expect the acceleration to be in z direction -9.81 and zero otherwise.

  seq: 150358
    secs: 376
    nsecs: 345000000
  frame_id: "kinova_link_6"
  x: -0.707163260091
  y: 0.492549225252
  z: 0.00974669647696
  w: -0.507168991746
orientation_covariance: [1.0391111027982223e-18, 0.0, 0.0, 0.0, 1.0391111027982223e-18, 0.0, 0.0, 0.0, 0.0]
  x: 2.01395400932e-08
  y: -1.39027463744e-08
  z: -1.25824759946e-09
angular_velocity_covariance: [1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16]
  x: 4.7659779885
  y: 7.13092593212
  z: -4.76145551598
linear_acceleration_covariance: [1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16]

One thing that makes me think is the frame of the IMU measurement. I want to have it in world coordinates, not in the kinova_link_6 (which is just the last link of the robot).

Does anyone see a mistake in my URDF that could fix this problem?

Thanks a lot!

edit: I added <frameId>world</frameId> but still do not get the desired result.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-15 06:29:43 -0600

dofrey gravatar image

So I solved it by myself. Even though it's kind of a hack. The problem actually did not occur in the shown URDF above but in its parent URDF. I found, that only the joint after the last not fixed joint affects the wrong measurement. This means that after the last non fixed joint I got some fixed joints in between to place the IMU where I wanted it to be.

With adding a joint/link combination between the last non fixed joint and the first joint of my sensormount that had <origin rpy="0 0 0" xyz="0 0 0"/> the measurement were right then.

In the following question the same problem is described with the hector gazebo plugins but with another hack:

edit flag offensive delete link more

Question Tools



Asked: 2019-07-15 02:59:14 -0600

Seen: 751 times

Last updated: Jul 15 '19