# ekf_localization_node: what frame for IMU?

Hi there, I am trying to fuse GPS with IMU information with ekf_localization_node. For now I have tied by map and odom frames to be always the same, so I assume that GPS is giving absolute map positions, and report them in the map frame. I am confused about the IMU though: it's heading estimate should be in the map frame as it's absolute, but it's motion estimates should be in the base_link frame because they are relative to the robot. The imu message only has a single frame_id, so which should I set it to? Or do I perhaps need to send two copies of the imu message with two different frames there, and set up ekf_localization_node to only attend to the relevant measurements in each?

edit retag close merge delete

Sort by » oldest newest most voted

Ah, you've stumbled upon the ol' "in what frame is IMU data reported" issue. See these:

In ekf_localization_node, I assume the frame_id in the message is the frame in which the sensor is mounted, so you should produce a base_link->imu transform (try using static_transform_publisher).

more

Thanks Tom, good to hear that from the source!

( 2015-09-11 04:17:10 -0600 )edit

(My best current guess at what I think might be happening is that the IMU node is outputting messages in base_imu_link frame, so we're broadcasting tf's from this to /map then they will automatically be in the robot's frame already? So far I've not been using tf's at all, and assuming z components of the IMU quaternion was a global compass direction, but perhaps this is not the case then? Can anyone confirm this?)

more