0
$\begingroup$

Rosanswers logo

I'm working with the Phidgets Spatial 9-DOF IMU, and I'm having some difficulty figuring out exactly which frame_id to stuff into the sensor_msgs/Imu message.

This particular IMU combines a 3-axis accelerometer, 3-axis gyro, and a 3-axis magnetometer. Populating the linear acceleration and angular velocity fields of the IMU msg is trivial. Orientation is calculated (by my code) using data from both the accelerometer (pitch and roll) and magnetometer (yaw).

The part I'm stuck on is that the orientation is by definition absolute, since it's based on gravity and Earth's magnetic field. But the linear acceleration and angular velocities are relative. Since I plan to feed the Imu messages to a pose estimator (e.g. robot_pose_ekf), do I populate the frame_id with a absolute, static frame or a relative one?


Originally posted by wvonachen on ROS Answers with karma: 41 on 2011-05-13

Post score: 4

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You should populate the frame_id of the sensor_msgs/IMU message with the frame in which the sensor is mounted.

robot_pose_ekf doesn't use the orientation vector in an absolute sense (it actually calculates changes in heading). The frame only relates to orientation not translation for the case of the IMU (since it's inertial). If your IMU is oriented to base link, you can just fill the frame with base link. Otherwise, publish a static tf publisher from base_link to imu_frame for how your IMU is oriented relative to your base_link. This would be the technically correct way.

However, I don't think I've seen a node that uses IMU except in the same frame as base link. So your best bet is to align your IMU with base_link so that code that doesn't transform IMU data won't negatively affect you. If you can't mount your IMU in this way, I suggest you write a simple relay node that transforms it manually into base_link on another topic that you then use with the other nodes.


Originally posted by Chad Rockey with karma: 4541 on 2011-05-13

This answer was ACCEPTED on the original site

Post score: 4

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.