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

How to transform the acceleration data from IMU to velocity

asked 2014-09-18 20:51:55 -0500 gravatar image

I am currently using Xsens MTi-28A53G35 IMU for the the motion tracking on our robot. The IMU only puts out linear and angular acceleration and orientation data. Is there an node that can transform this to linear velocity so I can use it to localize the robot and help improve the accuracy of odometry.

edit retag flag offensive close merge delete


Mekateng gravatar image Mekateng  ( 2018-01-07 14:30:17 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-19 08:19:41 -0500

Tom Moore gravatar image

updated 2014-09-19 13:28:55 -0500

I'm guessing your IMU puts out linear acceleration, angular velocity, and absolute orientation. While I have a branch of robot_localization that will take in linear acceleration data, I should point out that the double integration of linear acceleration as your only source of absolute position will produce a really poor estimate. If you had some estimate of your vehicle's linear velocity, such as from your robot's wheel encoder odometry, then you'd definitely benefit from the linear acceleration data.

edit flag offensive delete link more


Update: the released version of robot_localization now supports this feature.

Tom Moore gravatar image Tom Moore  ( 2014-12-16 07:26:12 -0500 )edit

So robot_localization supports calculating the velocity with an IMU. How can I use this feature? I don't see a parameter that I can set. I understand that the imu0_config only describes which data should be used from imu0, am I wrong?

Holger gravatar image Holger  ( 2017-04-10 04:29:30 -0500 )edit

The IMU provides linear acceleration. Set those values to true, and the filter's kinematic model will integrate them into velocities. Be warned, though: there is no bias estimation, so biases will quickly cause the velocity to grow without bound (unless you have another velocity reference).

Tom Moore gravatar image Tom Moore  ( 2017-04-11 04:09:15 -0500 )edit

can i use "IMU" in linear movement to create a 2D map or calculate the linear velocity??

toqa elshahat gravatar image toqa elshahat  ( 2017-04-22 16:31:59 -0500 )edit

answered 2014-09-19 02:54:14 -0500

Wolf gravatar image

This is the task of the robot_pose_ekf ( ).

edit flag offensive delete link more



I don't believe robot_pose_ekf uses linear acceleration from the IMU, but rather only the absolute orientation. See the "imu_data" section of its wiki page.

Tom Moore gravatar image Tom Moore  ( 2014-09-19 08:12:47 -0500 )edit

@Tom Moore, hello. How can i go about this manually? Assuming I do have the linear_acceleration and orientation from the IMU sensor as you said. I have also generated a reference velocity from the robot wheel. Am more interested in ultimately finding the displacement. Thanks.

lxg gravatar image lxg  ( 2020-08-12 05:14:15 -0500 )edit

What are you trying to go about manually?

Tom Moore gravatar image Tom Moore  ( 2020-08-31 03:50:34 -0500 )edit

Converting the accelerometer and gyroscope data from IMU to displacement (distance ultimately). Speaking of which the data I got from the gazebo pluggin seems to be erroneous and the time_stamp is so inconsistent. You can check out this post about the kind of data I have:

lxg gravatar image lxg  ( 2020-08-31 05:29:44 -0500 )edit

You just need to integrate the values into velocities and then again into position. The data is in the sensor frame, so you'll need to transform the velocities into the world frame before you integrate them into position. Double integration won't work well, though, just be warned. Trying to get position data from accelerometers and gyros alone is, IMO, a waste of time, unless you only need it over a very short period. But YMMV.

Tom Moore gravatar image Tom Moore  ( 2020-09-29 04:57:08 -0500 )edit

Hello. I understood everything you said but I have no idea about how I should convert the data from the sensor frame to the world frame. Well there's nothing varying since this is the first time I will be doing this. I am looking at the hector plugin currently as a way to add gps simulation for my robot. As you pointed out, acceleration and gyro alone are indeed insufficient, furthermore, gazebo's IMU is not doing well at all for me right now. It gives symmetric gyroscope data as I pointed out in my earlier comment. a pain honestly. Thanks for the hints btw. How exactly do I go about converting my data from the sensor frame to the world frame? Again, thanks.

lxg gravatar image lxg  ( 2020-10-02 04:05:31 -0500 )edit

This should really be its own question, and it really belongs on, as it's not really a ROS question. There is ample documentation on the web for coordinate transformations.

Tom Moore gravatar image Tom Moore  ( 2020-10-02 04:14:05 -0500 )edit

ah no worries then. thanks. I will handle that.

lxg gravatar image lxg  ( 2020-10-02 04:16:13 -0500 )edit

Question Tools


Asked: 2014-09-18 20:51:55 -0500

Seen: 7,465 times

Last updated: Sep 19 '14