Linear WorldLinearAccel

9 views
Skip to first unread message

Tim Wilson

unread,
Mar 4, 2017, 12:27:49 AM3/4/17
to navx-mxp
I need to get the linear acceleration in the robot's direction of travel (RoboRio, Java). What AHRS call do I want? Frankly, I am confused by your documentation. In the Javadoc, it says (under getWorldLinearAccelY):

World linear acceleration refers to raw acceleration data, which has had the gravity component removed, and which has been rotated to the same reference frame as the current yaw value. The resulting value represents the current acceleration in the Y-axis of the body (e.g., the robot) on which the sensor is mounted.

If this call is in fact returning the acceleration along the Y-axis of the *body*, then why is it called "getWorldAccel", not "getBodyAccel"?

And, the above Javadoc description doesn't agree with what you say in the Terminology section under "World Reference Frame":

To account for this, navX-MXP’s motion processing adjusts each linear acceleration  value by rotating it in the opposition direction of the current yaw angle.  The result is an acceleration value that represents acceleration with respect to the area in which navX-MXP operates, which is known as “World Reference Frame”.  This world-frame linear acceleration value is much simpler to use for tracking motion of an object, like a robot, which might rotate while it moves.

So...to get the acceleration in the robot's direction of travel (body coords), what do I use? getWorldLinearAccelY(), or getRawAccelY()???

admin

unread,
Mar 4, 2017, 1:28:45 AM3/4/17
to navx-mxp
To get instantaneous Y axis acceleration in body reference frame, use getRawAccelY().

The world reference frame acceleration data is useful for estimating velocity and displacement in field coordinates (assuming the yaw zero is the head of the field).  Although the double-integrated accelerometer-based displacement data is accurate only to about a meter/15 seconds which is not very useful for FRC.
Reply all
Reply to author
Forward
0 new messages