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; 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!