Repository navigation
Check all six IMU axes for saturation - #16
Merged
Merged
Conversation
The saturated flag compared only gyro x and accelerometer z with their unclipped values. Clipping on the other four axes cleared the flag, so the measurement-saturated warning never fired for them. The flag now checks every axis of both vectors. Clipping itself is unchanged. Only the browser IMU device reads the flag. The headless state-sensor backend emits no sensor warning events at all (measurement-saturated, sample-dropped, gnss-outage), so headless runs still never warn. The browser devices and the headless backend wrap the same measurement functions in separate code. The differences between the two paths should be investigated in a later change. 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
buildImuMeasurementclips all six IMU axes toangularVelocitySaturationandlinearAccelerationSaturation. Thesaturatedflag compared only gyro x and accelerometer z with their unclipped values, so clipping on the other four axes left the flag false. The browser IMU device emitsmeasurement-saturatedfrom that flag, so the warning never fired for those axes.The flag and the clipping were added together in 3f4f1a0 and have not changed since.
Fix
Keep the unclipped vectors, clip them, and set the flag when any axis of either vector changed. The clipped values and every published field are unchanged.
Tests
Checked with a local script, outside the repo, with ranges of 1 rad/s and 12 m/s²:
mainnpm teston a clean checkout: 1964 pass, 6 skipped, 1 fail. The failure isPython decodes retained RGB, depth, and CameraInfo SFLog messages, which also fails onmain.Follow-up: headed and headless differ
Only the browser IMU device (
app/3d/devices/ManifestImu.js) reads this flag. The headless state-sensor backend (app/simulation/sensors/StateSensorBackend.js) emits no sensor warning events at all: nomeasurement-saturated,sample-dropped, orgnss-outage. Headless runs therefore still never warn.Both paths call the same functions in
LocalizationMeasurements.js, so measured values match. The scheduling, dropout, delivery and event code around them is separate. A change made in one wrapper can miss the other path. The differences between the two paths should be investigated in a later change.🤖 Generated with Claude Code