Robotics StackExchange | Archived questions

transforming linear acceleration - robot_localization

While inspecting the robotlocalization source code, i see the following in line 2469 of rosfilter.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;
  maskAcc = targetFrameTrans.getBasis() * maskAcc;

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);
  maskLin = targetFrameTrans.getBasis() * maskLin;
  maskRot = targetFrameTrans.getBasis() * maskRot;

Any clarification!

Asked by JadTawil on 2020-09-24 18:17:24 UTC

Comments

Answers

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.

Asked by Tom Moore on 2020-09-29 05:02:06 UTC

Comments

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?

Asked by JadTawil on 2020-09-29 05:59:28 UTC