Skip to content

Improve rigid body kinematics library - #1624

Merged
schaubh merged 3 commits into
developfrom
feature/fix_rigidBodyKinematics
Oct 17, 2026
Merged

schaubh merged 3 commits into
developfrom
feature/fix_rigidBodyKinematics

Conversation

@schaubh

@schaubh schaubh commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Description

Correct rigid-body kinematics conversions and composition that could produce invalid results or lose the represented rotation at identity, small rotations, half-turns, and Euler singularities. Preserve consistent behavior across C, Python, Numba, and the corresponding Rust bindings.

The branch contains three commits:

  1. Euler conversions and composition: Handle singularities across all twelve sequences and correct the C and Python self-check truth values.
  2. PRV and attitude boundary behavior: Preserve small rotations, handle zero-angle PRV rate limits, improve PRV/MRP composition, support multi-revolution angle wrapping, and preserve in-place C quaternion conversions.
  3. Python and Numba input compatibility: Preserve lists, tuples, and non-contiguous PRV arrays; correct dtype handling; and introduce wrappers and overloads that avoid deprecated Numba list reflection.

Numba public functions are now Python callables with compiled overloads. Dispatcher-specific attributes such as .py_func and .signatures are no longer part of the public interface.

The implementation retains straightforward double-precision formulas. Arbitrary extreme-value handling is intentionally outside the documented numerical scope.

Verification

Local RBK validation passed:

  • 1,044 Python/Numba tests, with Numba deprecation warnings treated as errors.
  • 68 native C/C++ tests.
  • 6 Rust tests.

Each commit was validated at its own revision. Regression coverage includes numerical boundaries, input containers, compiled calls, cache reuse, and in-place conversions. Incorrect Euler truth values were corrected; redundant and extreme-value tests were removed.

The consolidated branch matches the reviewed final implementation, with only the approved test-docstring correction.

Documentation

Updated the Numba guide to explain input conversion, compiled-call requirements, and the public callable interface. Added shared numerical limits and representation-singularity guidance. Consolidated the release notes and known-issues entries for both tickets.

Future work

No additional work is required for these tickets.

@schaubh schaubh self-assigned this Oct 16, 2026
@schaubh
schaubh requested a review from a team as a code owner October 16, 2026 22:32
@schaubh schaubh added bug Something isn't working enhancement New feature or request labels Oct 16, 2026
@schaubh schaubh added this to Basilisk Oct 16, 2026
@schaubh schaubh moved this to 👀 In review in Basilisk Oct 16, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T22:37:49.203233Z ba35936 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Preserve the represented rotation at and near singularities across all
12 Euler sequences in C, Python, and Numba. Recover the observable first
angle with the third angle set to zero at singularities, and compose
symmetric Euler sets through direction cosine matrices.

Correct the C and Python self-check truth values. Validate reconstruction
of identity, ordinary, singular, and near-singular rotations: 301
Python/Numba checks and 60 native C tests pass.
Preserve identity, small rotations, and half-turns in PRV conversions;
use analytic zero-angle limits in PRV rate maps and quaternion-based
composition for PRVs and MRPs. Wrap angles across multiple revolutions.

Retain simple double-precision formulas, add Python/Numba MRPshadow, and
preserve in-place C Gibbs/MRP-to-quaternion conversions. Extend the Rust
bindings and cover practical boundaries without extreme-value machinery.

Use explicit cross-product components so MRP composition compiles on
macOS worker stacks with current Numba. Allow roundoff at navigation
noise bounds and validate thruster impulse delivery using actual firing
delays and cancellation, alongside the short-run regulation response.

Validation: Python/Numba attitude checks, 68 native C tests, 6 Rust tests,
and affected navigation and thruster scenarios. Shortened-pulse mutations
are rejected by the delivery assertion.
Normalize sequence inputs and promote arithmetic to double precision in
MRP, Gibbs, and rate routines. Support non-contiguous PRV arrays and keep
MRPswitch threshold comparisons consistent with C and Rust.

Expose Python wrappers and Numba overloads instead of public dispatchers,
preserving list and tuple support without deprecated list reflection.
Document compiled-call requirements, consolidate release notes and known
issues, and state the shared numerical scope and representation limits.

Exercise cold compilation on a small worker-thread stack and reload the
compiled caller cache in a second process without adding a test case.

Validation: 1,053 Python/Numba and affected scenario tests with Numba
deprecation warnings treated as errors, 68 native C tests, and 6 Rust
tests. The final files match the reviewed working tree.
@schaubh
schaubh force-pushed the feature/fix_rigidBodyKinematics branch from e1ad9dd to 752dd83 Compare October 17, 2026 02:20
@schaubh
schaubh merged commit cbb0707 into develop Oct 17, 2026
7 checks passed
@schaubh
schaubh deleted the feature/fix_rigidBodyKinematics branch October 17, 2026 03:06
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Basilisk Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

Status: ✅ Done

1 participant