Skip to content

add forward projectors for all three kinematic models - #9

Open
zeerekahmad wants to merge 1 commit into
zeerekahmad/lint-precommit-cleanupfrom
zeerekahmad/kinematics-projectors
Open

add forward projectors for all three kinematic models#9
zeerekahmad wants to merge 1 commit into
zeerekahmad/lint-precommit-cleanupfrom
zeerekahmad/kinematics-projectors

Conversation

@zeerekahmad

Copy link
Copy Markdown
Contributor

PR: add forward projectors for all three kinematic models

  • branch: zeerekahmad/kinematics-projectors
  • base: zeerekahmad/lint-precommit-cleanup
  • commit: 958c561

Description

Introduces forward projection for all three kinematic models: simulation that ramps the actuator command
toward a target under a rate or acceleration limit, clamps it to the configured range, and integrates pose
with Euler. Each projector exposes step() for one time step and project() for a full horizon, returning a
timestamped state sequence whose element 0 is the initial state.

  • BicycleProjector, ArticulatedProjector and DifferentialDriveProjector, with Catch2 coverage for each.
  • Shared 2D geometry in pose2d.hpp: Pose2D, Point2D, Footprint (a CCW, unclosed polygon of any vertex
    count), normalizeAngle, transformFootprint, offsetAlongHeading and rectangleFootprint. Projectors
    optionally carry a body-frame polygon and emit it transformed into the world frame per sample, so the
    kinematic models stay dimension-free.
  • AxleReference selects which axle the bicycle and articulated projectors measure poses and footprints from.
    Motion is still integrated where each model is naturally defined (the rear axle) and converted on input and
    output, so no integration accuracy is traded for the choice.
  • ArticulatedModel gains an explicit articulation turning velocity (gamma-dot) on
    bodyVelocityToVehicleState and articulationToAxleVelocities, replacing the hardcoded zero constant. The
    two-argument forms remain as overloads assuming steady articulation, so existing callers are unaffected.
  • Those overloads make the existing bindings ambiguous: kinematics_pybind.cpp passed bare member-function
    pointers, which no longer resolve once a second overload exists. Both bindings move to py::overload_cast
    on the three-argument form and expose gamma-dot as a keyword argument defaulting to 0.0, so Python callers
    keep the two-argument call and gain the rate.
  • catch_discover_tests switches to DISCOVERY_MODE PRE_TEST. The default POST_BUILD runs each test binary
    during the build, where an older installed libpolymath_kinematics.so wins on LD_LIBRARY_PATH.

Migration Guide

None required — the additions are source and binary compatible. The two-argument C++ overloads and the
two-argument Python calls behave exactly as before (steady articulation, gamma-dot = 0).

Related issues

Completeness checklist

  • Is there test coverage? If it was a bugfix, is there a regression test?
  • Is user-facing API/behavior documented?
  • Is core documentation updated?
  • Are all checks green?
  • Assign reviewers to the PR and post in #code_reviews

Stack created with GitHub Stacks CLIGive Feedback 💬

Introduces BicycleProjector, ArticulatedProjector and DifferentialDriveProjector:
forward simulation that ramps the actuator command toward a target under a rate or
acceleration limit, clamps it to the configured range, and integrates pose with Euler.
Each exposes step() for one time step and project() for a full horizon, returning a
timestamped state sequence whose element 0 is the initial state.

Shared 2D geometry lands in pose2d.hpp: Pose2D, Point2D, Footprint (a CCW, unclosed
polygon of any vertex count), normalizeAngle, transformFootprint, offsetAlongHeading
and rectangleFootprint. Projectors optionally carry a body-frame polygon and emit it
transformed into the world frame per sample, so the kinematic models stay dimension-free.

AxleReference selects which axle the bicycle and articulated projectors measure poses
and footprints from. Motion is still integrated where each model is naturally defined
(the rear axle) and converted on input and output, so no integration accuracy is traded
for the choice.

ArticulatedModel gains an explicit articulation turning velocity (gamma-dot) on
bodyVelocityToVehicleState and articulationToAxleVelocities, replacing the hardcoded
zero constant. The two-argument forms remain as overloads assuming steady articulation,
so existing callers are unaffected.

Those overloads make the existing bindings ambiguous: kinematics_pybind.cpp passed bare
member-function pointers, which no longer resolve once a second overload exists. Both
bindings move to py::overload_cast on the three-argument form and expose gamma-dot as a
keyword argument defaulting to 0.0, so Python callers keep the two-argument call and gain
the rate.

catch_discover_tests switches to DISCOVERY_MODE PRE_TEST. The default POST_BUILD runs
each test binary during the build, where an older installed libpolymath_kinematics.so
wins on LD_LIBRARY_PATH.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant