Skip to content

Add mount offset acceleration to the IMU model - #14

Merged
JaidenAGrimminck merged 1 commit into
mainfrom
imu-mount-offset
Oct 16, 2026
Merged

JaidenAGrimminck merged 1 commit into
mainfrom
imu-mount-offset

Conversation

@clmazzac

Copy link
Copy Markdown
Member

Problem

The IMU reported base_link acceleration wherever it was mounted. On a rigid body, a point at offset r from base_link also has two extra terms:

  • tangential: α × r, from changing yaw rate
  • centripetal: ω × (ω × r), from turning

Measured on main in a steady 0.5 rad/s turn at 3 m/s, with the IMU 1 m ahead and 0.5 m left: the IMU read 0 m/s² forward and 1.5 m/s² left, the same as at base_link. Physics gives -0.25 and 1.375.

Fix

  • captureVehicleSnapshot adds bodyAngularAcceleration, the yaw-rate change since the previous snapshot.
  • New accelerationAtOffset(snapshot, offset) adds both terms with Three.js Vector3.crossVectors.
  • buildImuMeasurement uses it with the IMU mount position (sensorConfig.pose.position) before gravity and the sensor rotation.

Checked with a local script, outside the repo, IMU at (1, 0.5, 0):

Case IMU reading (forward, left) Expected
Steady 0.5 rad/s turn -0.250, 1.375 -0.250, 1.375
Yaw rate rising at 0.2 rad/s² -0.110, 0.495 -0.110, 0.495

Effect on existing runs

The default IMU mount is at base_link, so default runs do not change. Only runs with an offset IMU mount see new values.

Tests

  • npm test on a clean copy of main with this and the other open sensor PRs merged: 1968 pass, 6 skipped, 1 fail. The failure is Python decodes retained RGB, depth, and CameraInfo SFLog messages, which also fails on main.
  • No unit test is added in this PR.

🤖 Generated with Claude Code

The IMU reported base_link acceleration wherever it was mounted. On a
rigid body, a point at offset r also feels alpha x r and
omega x (omega x r). In a 0.5 rad/s turn, an IMU 1 m ahead and 0.5 m left
of base_link should read -0.25 m/s^2 forward and 1.375 m/s^2 left, not 0
and 1.5.

The vehicle snapshot now carries yaw acceleration, and the IMU adds both
terms for its mount position. The default IMU mount is at base_link, so
default runs do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JaidenAGrimminck
JaidenAGrimminck merged commit 8c569dc into main Oct 16, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants