Skip to content

Add normalized to SE2 and SE3 #377

Done

Description

@kmolan

What: SO2::normalized and SO3::normalized remove the drift that a long composition chain puts into a rotation. Poses drift in the same way (odometry composes an SE2 each tick), but SE2 and SE3 have no normalized. The only fix today is to rebuild the pose with from_parts. Add pub fn normalized(self) -> Self, with #[inline] and #[must_use], to both types: Self::from_parts(self.rotation.normalized(), self.translation). The translation does not change.

Where: crates/multicalc/src/spatial/lie/se2.rs and crates/multicalc/src/spatial/lie/se3.rs. Copy SO3::normalized in lie/so3.rs. Tests go in crates/multicalc/tests/suite/spatial/lie.rs.

How to test: cargo test -p multicalc. Copy so2_normalized_removes_composition_drift in lie.rs. For SE2: compose SE2::from_parts(SO2::from_angle(0.3), Vector::new([0.1, 0.0])) 10 000 times, assert that the rotation norm drifted by more than f64::EPSILON, then assert that normalized() gives a rotation norm within f64::EPSILON of 1 and the same translation (exact equality). For SE3: compose a pose 10 000 times, and assert that normalized() gives a quaternion norm within 4.0 * f64::EPSILON of 1 and the same translation.

Activity

  1. added
    help wanted
    good first issue
    spatial
    accuracy
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accuracygood first issuehelp wantedspatial

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions