Add centripetal acceleration to the simulated IMU - #6
Merged
Merged
Conversation
The IMU took body acceleration from the derivative of body-frame velocity. The body frame rotates with the vehicle, so that derivative omits omega x v. In a steady turn the body-frame velocity is constant and the IMU reported no lateral acceleration. Add the omega x v term. Lateral acceleration is now yaw rate times forward speed, toward the turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The simulated IMU reports no lateral acceleration in a turn.
captureVehicleSnapshottakes body acceleration from the derivative of body-frame velocity. The body frame rotates with the vehicle, so that derivative omitsomega x v. In a steady turn the body-frame velocity stays(speed, 0, 0), and the result is zero. A real accelerometer readsspeed * yaw ratetoward the turn.A filter that uses lateral acceleration then sees a reading that contradicts the gyro. An EKF with the measurement model
a_y = v * omegadrove its speed estimate toward zero in each turn.Fix
Add the
omega x vterm to the body acceleration incaptureVehicleSnapshot:a_y += yawRate * v_xa_x -= yawRate * v_yOnly the IMU reads
bodyAcceleration.Measurements
One scenario, run before and after: about 90 m with two turns, route follower at 3 m/s. IMU messages were recorded from the orchestrator. The internal pose came from the run's SFLog. Both runs also had #5 applied. This change does not depend on #5.
linear_acceleration.yvs speed x yaw rate, while turning (least-squares slope)linear_acceleration.yin a turnz, accelx, accelz, 3,620 samplesEffect on an external EKF (IMU yaw rate, lateral acceleration and GNSS), position error against
visualization.localization.error:Tests
npm test: 1,892 of 1,899 pass. The one failure,Python decodes retained RGB, depth, and CameraInfo SFLog messages, also fails onmainon my machine.localization-sensors.test.js:speed * yaw rateon IMUy, with the sign of the turn, for both directions. This test fails onmain.Not in this change
An IMU mounted away from the vehicle reference point also feels terms from that offset (
alpha x randomega x (omega x r)). The default IMU sits at the reference point, so this change omits them.🤖 Generated with Claude Code