-
Notifications
You must be signed in to change notification settings - Fork 26
Add INERTIAL_FIXED_REPRESENTATION to velocity representations #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- substitute for some quantites the default mixed naming with a more general one. - refactor jacobian_dot velocity repr handling by selecting the appropiate adjoint functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for the INERTIAL_FIXED_REPRESENTATION frame velocity representation to the rigid body dynamics algorithms in the ADAM library. This expands the library's capability to handle a third type of velocity representation alongside the existing body-fixed and mixed representations.
Key changes include:
- Added
INERTIAL_FIXED_REPRESENTATIONto theRepresentationsenum - Implemented transformation logic across all core RBD algorithms (CRBA, Jacobian computations, RNEA, ABA) to properly handle the inertial-fixed frame
- Updated test infrastructure to include the new representation in test configurations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/adam/core/constants.py | Added INERTIAL_FIXED_REPRESENTATION enum value to support the new frame representation type |
| src/adam/core/rbd_algorithms.py | Implemented inertial-fixed representation logic across all major algorithms including appropriate adjoint transformations, Jacobians, and dynamics computations |
| tests/conftest.py | Extended test configuration to include INERTIAL_FIXED_REPRESENTATION in velocity representation test cases and added mapping to iDynTree representation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| B_X_BI = math.factory.eye(batch_shape + (6,)) | ||
| B_X_I = math.factory.eye(batch_shape + (6,)) | ||
| transformed_acc = math.factory.zeros(batch_shape + (6,)) | ||
| elif self.frame_velocity_representation == Representations.MIXED_REPRESENTATION: | ||
| B_X_BI = math.adjoint_mixed_inverse(base_transform) | ||
| B_X_I = math.adjoint_mixed_inverse(base_transform) | ||
| omega = base_velocity[..., 3:] | ||
| vlin = base_velocity[..., :3] | ||
| skew_omega_times_vlin = math.mxv(math.skew(omega), vlin) | ||
| top3 = -math.mxv(B_X_BI[..., :3, :3], skew_omega_times_vlin) | ||
| top3 = -math.mxv(B_X_I[..., :3, :3], skew_omega_times_vlin) | ||
| bot3 = math.factory.zeros(batch_shape + (3,)) | ||
| transformed_acc = math.concatenate([top3, bot3], axis=-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes in the non-inertial fixed code path intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! Before everything was written in mixed (e.g. B_X_BI), also for body fixed and I wanted to make it more generic.
But now, thinking twice, I could define a generic frame C and specify in a comment to which frame I'm referring to (e.g. C = B[I]).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in aac1bcb!
traversaro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor comment.
|
Thanks @traversaro! Merging. |
This pull request adds support for the
INERTIAL_FIXED_REPRESENTATIONframe velocity representation throughout the rigid body dynamics algorithms.Support for INERTIAL_FIXED_REPRESENTATION in core algorithms:
INERTIAL_FIXED_REPRESENTATIONto theRepresentationsenum inconstants.py.block_index,jacobian,relative_jacobian,jacobian_dot,CoM_jacobian,rnea,aba, and related helper logic) inrbd_algorithms.pyto implement logic for the inertial-fixed representation, including appropriate transformations, Jacobians, and derivatives. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Test infrastructure updates:
INERTIAL_FIXED_REPRESENTATIONin the list of velocity representations tested inconftest.py, ensuring coverage in all relevant robot configurations.📚 Documentation preview 📚: https://adam-docs--144.org.readthedocs.build/en/144/