ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Imu Integration with Mobile Robot

asked 2020-11-27 06:03:04 -0500

bfdmetu gravatar image

updated 2020-11-27 06:26:28 -0500

Hi. I am working on a mobile robot. I want to use xsense imu.

I can get the imu/data. When i turn the imu, i can see it turns in RVİZ. However my robot (base_link) doesn't move-turn.

Example In youtube Leo Rover account. If the imu turn , leo robot will turn in rviz.

My Robot

There should be something missing. But where it is?

xsense_topic topic publish base_link--->imu_link tf

my urdf file publish with robot state publish (map-odom-base-footprint-base_link-imu) map-odom-foot_print-base_link are published by static transform ( static transform publisher)

base_link-other components was published by robot state publisher

image description

this is my urdf file related imu

<link name="imu_link">
      <origin rpy="0 0 1.57079632679" xyz="0.0121 0 0.0016"/>
        <mesh filename="package://optim/meshes/mti_1.STL" scale="0.001 0.001 0.001"/>
      <material name="xsens_orange">
        <color rgba="0.92 0.45 0.02 1.0"/>
      xyz="0.0 0 0.278189004081027"
      rpy="0 0 0" />
      link="base_link" />
      link="imu_link" />
      xyz="0 0 0" />
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2020-11-27 07:21:02 -0500

Dragonslayer gravatar image

updated 2020-11-27 07:22:20 -0500

Most ot the time the imu data is fused with odometry and thus influences the odom->base_link transform. Usually via ekf_localization_node

I checked leorover github (link text). It seems all should work fine, but in the


you might want to change Line 3

  <arg name="three_d" default="false"/>

set this to "true", the odometry is in 2d mode by default.

edit flag offensive delete link more


Thank you for reply. I notice that if i change the imu_link-->base_link transform, the robot model turn with imu. If i use base_link-->imu_link ,robot model does not move when i turn the imu...

I guess if i turn the imu, shouldn't the robot model stay motionless.

I am asking another. What is the difference between robot_pose_ekf (package) and ekf_localization_node (robot_localization package)

To get better localization , which is the best ?

Second question is

When we navigate the robot on the map, how can we determine its localization?

using frames ( which frames) or topics (amcl_pose ) or something else ?

bfdmetu gravatar image bfdmetu  ( 2020-11-28 07:28:55 -0500 )edit

Did you try my suggestion? Do you use the Leo stack from github? Where do you change "base_link-->imu_link"? What file? -Those two ekf nodes are similar but Leo uses ekf_localization_node. -As the Leo github collection says it uses amcl for localization, but needs gmapping first to build a map. Theoretically one could only use known starting_position an odometry (dead reckoning) but odometry errors accumulate very fast and the robot would be lost in a very short time.

Dragonslayer gravatar image Dragonslayer  ( 2020-11-30 07:08:34 -0500 )edit

I change base_link-->imu_link in my urdf file.Not in Leo robot file. Today i try to integrate Leo ekf_localization_node configuration in my file.

I have a known map. I build it with gmapping.

Do i ask one more thing?

My odom file publish odom0 topic and odom_frame-->base_link transformation... My ekf file subscribe odom0 topic and imu/data topic and publish odom topic... And also publish odom_frame-->base_link transformation.

In that way 2 different node publish same transfer function odom_frame--> base_link... Is this right way or do i need to change frames name , tf.

bfdmetu gravatar image bfdmetu  ( 2020-12-01 00:06:50 -0500 )edit

Well, you should only have one braodcaster per tf transform. Usually odometry nodes have a parameter to switch on/off tf publishing. Thus if you use ekf switch off the odometries tf. But be aware the odometry message itself is not a tf broadcaster.

Dragonslayer gravatar image Dragonslayer  ( 2020-12-01 07:44:47 -0500 )edit

answered 2022-12-06 10:40:22 -0500

Raza Rizvi gravatar image

updated 2022-12-06 10:43:37 -0500

The base_link -> imu_link should be a "static/fixed transform", reflecting the fact that the imu is FIXED to the base of the robot. So, when the imu_link moves, the base_link moves respectively.

Then, there should be a fixed reference frame (world or map or ...), with respect to which the imu_link should be moved (dynamic transform), resulting in the movement of the robot. This dynamic transform publishing (world -> imu_link) is the work of the imu_sensor package.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-11-27 06:03:04 -0500

Seen: 646 times

Last updated: Dec 06 '22