# transforming linear acceleration - robot_localization

While inspecting the robot_localization source code, i see the following in line 2469 of ros_filter.cpp:

  // Transform to correct frame
// @todo: This needs to take into account offsets from the origin. Right now,
// it assumes that if the sensor is placed at some non-zero offset from the
// vehicle's center, that the vehicle turns with constant velocity. This needs
// to be something like
// accTmp = targetFrameTrans.getBasis() * accTmp - targetFrameTrans.getOrigin().cross(rotation_acceleration);
// We can get rotational acceleration by differentiating the rotational velocity
// (if it's available)
accTmp = targetFrameTrans.getBasis() * accTmp;


I am curious, why are we assuming that the imu is not offset from the center of the robot? Clearly on most robots this will be the case.. It seems like the correct code is commented out. Also, it seems like this is done properly in prepareTwist() line 3006:

  // Transform to correct frame. Note that we can get linear velocity
// as a result of the sensor offset and rotational velocity
measTwistRot = targetFrameTrans.getBasis() * measTwistRot;
twistLin = targetFrameTrans.getBasis() * twistLin + targetFrameTrans.getOrigin().cross(stateTwistRot);


Any clarification!

edit retag close merge delete

Sort by » oldest newest most voted I am curious, why are we assuming that the imu is not offset from the center of the robot?

We aren't. :) The comment is marked as todo, which means I know it needs to be done, but I didn't have the cycles to test it. But I welcome PRs.

more

No problem, I will uncomment and try.

Another couple questions, can you provide some references for the mathematics involved in transforming the angular velocities and linear accelerations from one frame to another?

What advise would you give for performing an extrinsic calibration between IMU and base_link on a real robot?