Fix mirrored REP-103 positions in the Three.js frame conversion - #5
Merged
Merged
Conversation
Three.js is right-handed. With +X forward and +Y up, +Z is the vehicle's right. The conversion mapped Three.js +Z to REP-103 +Y, which is left. That is a reflection. It mirrored positions but not yaw or yaw rate, so a vehicle moved toward +Y while its yaw pointed toward -Y. Map REP-103 +Y to Three.js -Z in the vector and Euler basis helpers. Use the same mapping in the places that converted by hand: lidar point packing, oracle bounds, the analytic GPU sensor mount, and the localization overlay. Write each negation as `0 - v`. Negative zero breaks strict equality and the run bundle digest. 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
Published positions are mirrored left to right. Yaw and yaw rate are not. In a turn, the published position curves one way and the heading turns the other way.
CoordinateFrames.jsassumes the Three.js scene is+Xforward,+Yup,+Zleft. Three.js is right-handed, so with+Xforward and+Yup,+Zis the vehicle's right. The conversion maps Three.js+Zto REP-103+Y(left). That is a reflection, not a rotation.Three checks, none of which depend on this change:
threeCameraLookAlongMountForwardRotation()puts image-right on Three.js+Z.GeoFrametest asserts "east-up-south": north is-Z. The GNSS sensor reported north as+Z.Fix
Map REP-103
+Yto Three.js-Z:CoordinateFrames.js: the two vector helpers and the two Euler helpers. The pitch component changes sign with the axis.SensorMessages.js) now uses the existinglidarShaderDirectionToRep103PerceptionTruthIndex.js); min and max swap on the negated axisAnalyticGpuScene.js)AutonomyVisualizationModel.jsEach negation is written
0 - v. A plain-vgives-0for zero, and that broke strict equality and the run bundle digest in two existing tests.Measurements
One scenario, run before and after: about 90 m with two turns, route follower at 3 m/s. Sensor messages were recorded from the orchestrator. The internal pose came from the run's SFLog.
z(least-squares slope)xBehavior changes
Every published lateral coordinate changes sign: GNSS north, odometry and TF
y, lidar points, oracle boxes. A sensor mounted with a non-zeroyoffset, or with pitch, moves to the side its manifest states. Code that compensated for the mirror must remove that compensation.Tests
npm test: 1,893 of 1,900 pass. The one failure,Python decodes retained RGB, depth, and CameraInfo SFLog messages, also fails onmainon my machine.coordinate-frames.test.js. They fail onmain:+0yNot in this change
ControlsPathArc.js,spatial/planview/transform.jsanddocs/vehicle-manifests.mdalso say "+Zleft". Their code works in Three.js space only, so I left them.🤖 Generated with Claude Code