[#97] Modernize Eigen MRPd support and attitude conversions - #1464
[#97] Modernize Eigen MRPd support and attitude conversions#1464schaubh wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abdf08ddd3
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| TEST(eigenMRP, testCoefficientConstructorsAndAccessors) { | ||
| const double rawCoefficients[3] = {0.10, -0.20, 0.30}; // [-] | ||
|
|
||
| Eigen::MRPd fromScalars(0.10, -0.20, 0.30); |
There was a problem hiding this comment.
Add unit comments to MRP literal definitions
AGENTS.md requires trailing inline unit comments for numeric literal assignments/definitions when the quantity has physical meaning. These added MRP coefficient definitions are dimensionless attitude quantities, but this line (and the similar new MRP/vector coefficient definitions in this test) lacks a // [-] unit comment, so it violates the repository's review rule.
Useful? React with 👍 / 👎.
731e11b to
d5b6f41
Compare
Update MRP conversion helpers to accept and return Eigen::MRPd directly, and convert clear attitude read sites away from generic Vector3d handling. Add focused test coverage updates and a release-note snippet.
Update hub and state-effector dynamics methods to pass attitude MRPs as Eigen::MRPd instead of generic Vector3d values. Convert spacecraft and spacecraftSystem callers to construct MRPd values at hub-state reads, and clean up now-redundant attitude casts in affected state effectors.
Fix Eigen MRP conversion and operator behavior so DCM/AngleAxis conversions, composition, vector rotation, scalar casts, and setFromTwoVectors behave consistently with Basilisk MRP conventions. Keep DCM-to-MRP conversion on the short-rotation set and clarify MRP norm/normalization documentation. Expand avsEigenMRP unit coverage across constructors, maps, assignment, composition, shadow sets, Bmat, inverse/conjugate, angular distance, and casts. Update the MuJoCo integration attitude comparison to be robust to quaternion sign while preserving strict checks on the remaining qpos states.
Migrate remaining internal semantic MRP attitudes from Eigen::Vector3d detours to Eigen::MRPd where this does not cross message, state-manager, Python/SWIG, or estimator-state storage boundaries. Keep raw coefficient vectors at those boundaries and convert with MRPd only where attitude operations are performed.
d5b6f41 to
864ac0e
Compare
Description
This PR modernizes Eigen MRP support and moves selected attitude handling to
Eigen::MRPdwhere the values semantically represent MRPs. The commits are organized as small library upgrades and then downstream usage updates, ending with a standalone release-note snippet.Key changes include more robust
Eigen::MRPdconversions, short-rotation quaternion/DCM handling, scalar casts for mapped MRP expressions, clearer assignment diagnostics, and expanded MRP unit test coverage. Dynamics attitude interfaces now pass MRP attitudes asEigen::MRPdwhile preserving raw vector storage at state/message/SWIG boundaries.Verification
Validated with:
make -C dist3 test_avsEigenMRPmake -C dist3 test_avsEigenSupportdist3/architecture/utilities/tests/test_avsEigenMRPdist3/architecture/utilities/tests/test_avsEigenSupport.venv/bin/pytest -q src/simulation/mujocoDynamics/_GeneralModuleFiles/_UnitTest/test_integration.pygit diff --check origin/develop...HEADThe MRP GoogleTest suite was expanded to cover constructors, maps, casts, assignment paths, DCM/AngleAxis conversion branch behavior, composition, shadow sets,
setFromTwoVectors(), coefficient arithmetic, and small-vector handling.Documentation
Updated
avsEigenMRP.hDoxygen comments to clarify MRP norm/normalization behavior, coefficient arithmetic, supported assignment paths, and helper internals. Added a release-note snippet documenting theEigen::MRPdconversion updates and theeigenMRPd2CArray()signature change. UpdatedAGENTS.mdreview guidance to check forEigen::MRPduse where appropriate.Future work
None