Repository navigation
Conversation
inuex35
force-pushed
the
feature/nhc-factor-upstream
branch
2 times, most recently
from
November 13, 2026 09:04
3543818 to
7bc1317
Compare
Add NHC factors for cars and other non-holonomic robots. A wheeled vehicle
that does not slip has no lateral or vertical velocity at its reference
point (e.g. the rear-axle center). The factors express that velocity in
the vehicle frame and constrain its lateral and vertical components:
v_point = wRb^T * v_world + omega x leverArm
v_vehicle = bRv^T * v_point
error = [v_vehicle.y, v_vehicle.z]
The forward speed is left unconstrained, so the factors combine with any
wheel-odometry or velocity measurement.
Two variants, matching the GPSFactor / GPSFactorArmCalib convention:
- NhcFactor (Pose3, Vector3): the mounting rotation bRv is a
fixed constant (default identity)
- NhcFactorCalib (Pose3, Vector3, Rot3): bRv is an estimated variable,
for online calibration
Only the pitch and yaw of bRv are observable; rotation about the forward
axis (roll) is never observable from the NHC alone. This is documented and
checked by a test.
Wrapped in navigation.i. C++ tests cover the error definition, analytic
Jacobians, agreement between the fixed and estimated variants, forward-axis
unobservability, lever-arm compensation on a turning ConstantTwistScenario,
serialization round-trips, and optimization of velocity and mounting yaw.
A Python test exercises the wrapped constructors, accessors, and errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
inuex35
force-pushed
the
feature/nhc-factor-upstream
branch
from
November 13, 2026 09:35
7bc1317 to
a9ec10d
Compare
ProfFan
reviewed
Nov 16, 2026
ProfFan
left a comment
Collaborator
There was a problem hiding this comment.
some minor comments, should be good to go after them :)
| using symbol_shorthand::X; | ||
|
|
||
| /* ************************************************************************* */ | ||
| namespace generic_state { |
Collaborator
There was a problem hiding this comment.
The tests miss vertical lever-arm compensation, all unit tests passed without it
| const gtsam::Vector3& velocity) const; | ||
| const gtsam::Vector3& angularVelocity() const; | ||
| const gtsam::Vector3& leverArm() const; | ||
| const gtsam::Rot3& mountRotation() const; |
Collaborator
There was a problem hiding this comment.
void serialize() const; for both
| np.testing.assert_allclose(aligned.evaluateError(self.pose, velocity), | ||
| [0.2, -0.3], atol=1e-9) | ||
|
|
||
| def test_calib_matches_fixed_factor(self): |
Collaborator
There was a problem hiding this comment.
I think there is an ambiguity in initialization (0 vs +pi). If so, document that initialization ambiguity and test a mount with both pitch and yaw differences.
- Test vertical lever-arm compensation: a roof-mounted IMU under a roll rate is compensated only by the vertical lever-arm component, and dropping it leaves a lateral error of -omega_x * height. - Wrap serialize() for NhcFactor and NhcFactorCalib, with a Python pickle round-trip test. - Document that the NHC cannot tell the forward axis from the backward axis, so NhcFactorCalib has two minima selected by initialization. Test a mount differing in both pitch and yaw, recovering its forward axis from identity and the flipped axis from a yaw-pi initialization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcxMmH57diwYwoMExn65U7
Contributor
Author
|
Thanks for the review!
|
This branch has not been deployed
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.
I would like to add
NhcFactorandNhcFactorCalibfor non-holonomic robots. They constrain the lateral and vertical velocity of the vehicle reference point to zero in the vehicle frame, with lever-arm compensation.NhcFactor(pose, velocity): the mounting rotation is a fixed constant.NhcFactorCalib(pose, velocity, mountRotation): the mounting rotation is estimated online.