Skip to content

expose the projectors and shared geometry to Python - #11

Open
zeerekahmad wants to merge 1 commit into
zeerekahmad/kinematics-dual-buildfrom
zeerekahmad/kinematics-python-bindings
Open

expose the projectors and shared geometry to Python#11
zeerekahmad wants to merge 1 commit into
zeerekahmad/kinematics-dual-buildfrom
zeerekahmad/kinematics-python-bindings

Conversation

@zeerekahmad

Copy link
Copy Markdown
Contributor

PR: expose the projectors and shared geometry to Python

  • branch: zeerekahmad/kinematics-python-bindings
  • base: zeerekahmad/kinematics-dual-build
  • commit: 1c96c08

Description

Brings the new C++ API to Python.

  • Binds Pose2D, Point2D, AxleReference, rectangle_footprint and transform_footprint, plus all three
    projectors and their projected-state structs. Footprint is std::vector<Point2D>, which pybind11/stl.h
    renders as a plain list of Point2D; the package aliases it so annotations can name the concept.
  • Removes Twist2D, normalize_angle and transform_pose from the Python package. They were leftovers
    from when Pose2D was a Python shim, and are superseded by the bound C++ Pose2D and normalizeAngle.
  • ament_add_pytest_test now names test_python_bindings.py explicitly rather than the test directory, so
    adding a pytest suite doesn't silently join this target, and runs it from the source directory.

Migration Guide

Breaking for Python callers of the removed shims:

  1. Replace from polymath_kinematics import Twist2D with the bound C++ types — construct the body command
    directly from the model/projector API (linear_velocity_m_s, angular_velocity_rad_s).
  2. Replace normalize_angle(theta) with the bound normalize_angle from the C++ normalizeAngle.
  3. Replace transform_pose(...) with Pose2D and transform_footprint(...).

No C++ callers are affected.

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 💬

Binds Pose2D, Point2D, AxleReference, rectangle_footprint and transform_footprint, plus
all three projectors and their projected-state structs. Footprint is std::vector<Point2D>,
which pybind11/stl.h renders as a plain list of Point2D; the package aliases it so
annotations can name the concept.

Removes Twist2D, normalize_angle and transform_pose from the Python package. They were
leftovers from when Pose2D was a Python shim, and are superseded by the bound C++ Pose2D
and normalizeAngle.

ament_add_pytest_test now names test_python_bindings.py explicitly rather than the test
directory, so adding a pytest suite doesn't silently join this target, and runs it from
the source directory.

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