Ask Your Question
0

How to convert IMU data to quaternion orientation

asked 2018-03-20 11:40:05 -0600

Robbe_C gravatar image

Hello

I'm trying to fuse my IMU data (and GPS data) with the package robot_localization. Therefore, I have to put my IMU data into a sensor_msgs/Imu message. I know it is possible to convert my IMU data (accelerometer, gyroscope and magnetometer) into a quaternion orientation message. However, I wonder if there is a package available to do this transformation for me, or do I have to write code myself? If so, how would I start?

Thanks in advance! Kind regards Robbe

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-20 13:33:33 -0600

stevejp gravatar image

Just to clarify - you are not converting your accelerometer / gyros / magnetometer measurements into an orientation, you are using those raw measurements to estimate your orientation. The madgwick and complementary filter are both capable of doing exactly what you need.

edit flag offensive delete link more

Comments

The robot_localization package that the OP originally suggested can also do this.

ahendrix gravatar imageahendrix ( 2018-03-20 14:14:37 -0600 )edit

@ahendrix I didn't think robot_localization dealt directly with magnetometer measurements. Can you explain how you would do this?

stevejp gravatar imagestevejp ( 2018-03-20 15:05:53 -0600 )edit

I believe the navsat_transform_node can handle magnetometer measurements: http://docs.ros.org/lunar/api/robot_l...

ahendrix gravatar imageahendrix ( 2018-03-21 00:15:47 -0600 )edit

Thank you for the quick respone! I think you are talking about the use_odometry_yaw parameter of navsat_transform_node, right? Maybe that's even easier.

Robbe_C gravatar imageRobbe_C ( 2018-03-21 06:06:22 -0600 )edit

I don't think the navsat_transform_node is what you need. Navsat_transform is used to transform GPS measurements into odometry which you can fuse in robot_localization.

stevejp gravatar imagestevejp ( 2018-03-21 06:31:46 -0600 )edit

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

Stats

Asked: 2018-03-20 11:40:05 -0600

Seen: 1,781 times

Last updated: Mar 20 '18