Skip to content

kinematics: measure ToF hit range from the trunk axis - #441

Open
Amidwestnoob wants to merge 2 commits into
pollen-robotics:mainfrom
Amidwestnoob:fix/tof-range-trunk-axis
Open

Amidwestnoob wants to merge 2 commits into
pollen-robotics:mainfrom
Amidwestnoob:fix/tof-range-trunk-axis

Conversation

@Amidwestnoob

Copy link
Copy Markdown

Fixes #430.

Zone::Hit::range now measures horizontal distance from the trunk origin's vertical axis, as documented. It uses the horizontal norm of the gravity-levelled hit point, including the sensor's offset from the trunk. Points remain in the trunk frame, and the short-range noise filter still measures horizontal distance from the sensor; floor classification is unchanged.

Regression tests cover level and walking head poses, trunk tilt, head yaw/roll, every grid zone, and the sensor-relative noise threshold. An independent distance-to-gravity-axis oracle checks the range without reusing the levelling rotation. The one-metre sanity check now rejects the old sensor-relative result.

Validation on Rust 1.89.0:

  • Original implementation with the final regression tests: five assertion failures, including the independent geometry check.
  • Final cargo test -p kinematics --locked: 37 passed, two existing performance probes ignored.
  • cargo fmt -p kinematics -- --check and cargo clippy -p kinematics --all-targets --locked -- -D warnings: passed.

The existing MuJoCo FK fixture comparison passed. Live stand/drive simulation was not rerun because the simulator checkout and Python environment were unavailable; no hardware testing was performed. Full workspace CI remains to run on this PR.

Zone::Hit documents range as the horizontal distance from the trunk
origin's vertical axis, but project() computed it from the sensor, so it
came out short by the sensor's forward offset (~8 cm with a level head).
Compute it from the gravity-levelled point instead. The short-range
noise band stays judged from the sensor, since the crosstalk is the
sensor's own.

Regression tests check range against the levelled point's horizontal
norm for a level head, a walking head pose and a leaned trunk.

Fixes pollen-robotics#430
Keep the trunk-axis geometry fix and replace its permissive sanity window with a mount-specific range check. Exercise all zones under head yaw/roll and trunk tilt using distance to the gravity line, independent of the levelling quaternion. Pin the sensor-relative noise boundary and untrusted-gravity fallback.

Assisted-by: GPT-6 Astra

This branch has not been deployed

No deployments
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.

kinematics::tof: Zone::Hit range is measured from the sensor, not the trunk axis as documented

1 participant