New/fixing derivs no benchmarks#100
Open
DVolpi256 wants to merge 170 commits into
Open
Conversation
DVolpi256
commented
May 26, 2026
- Implemented a new algorithm called firstOrderInverseDynamicsDerivatives in ClusterTreeDynamics.cpp that computes the first-order derivatives of rigid-body dynamics for closed-chain kinematic systems.
- Two new unit tests were added to validate the new algorithm: testInverseDynamicsDerivativesSimple validates the algorithm against a first-order finite difference to an accuracy on the order of 10^-8 and testInverseDynamicsDerivativesComplexStep validates the algorithm against a complex step derivative to an accuracy on the order of 10^-14 (i.e., machine precision).
- New terms were added to handle the new algorithm. This is especially apparent in GenericJoint.h and GenericJoint.cpp, where new CasADi functions to handle the presence of a configuration-dependent joint motion subspace matrix S.
- A new model of Agility Robotics' Cassie and model variants of the Tello robot were added to evaluate the algorithm's handling of closed-chain kinematic systems. A model of the KUKA LWR 4+ robot was also added to test a real robot arm.
Has temporary variables for the backward pass as well. Comments are made for new functions that need to be implemented.
…ded some efficiencies after review.
… two unit test files and fixed the resulting type issues.
Need Casadi to add additional terms
Merging to add support for Ubuntu 24 instead of 18
…tives function in testRBDAlgos
… 456 of ClusterTreeDyamics.cpp. The error pertains to a segmentation fault that I believe is related to the usage of the Psi_dot_ term.
…h a finite difference for fixed-base robots.
…finite difference and the other does a complex step. They work well for the double pendulum case. The three link and four link serial chains and Mini Cheetah have larger errors.
…s derivatives tests now pass.
… Cheetah. Examining how to get the complex step working and whether testRigidBodyDynamicsAlgosDerivatives is now broken.
…aking the existing unit tests.
- Reverted src/Dynamics/ClusterTreeDynamics.cpp to e1bf655 - Reverted include/grbda/Utils/OrientationTools.h to e1bf655 - Reverted src/Dynamics/ClusterJoints/FreeJoint.cpp to e1bf655 - Reverted src/Robots/MiniCheetah.cpp to e1bf655 - Reverted UnitTests/testHelpers.hpp to e1bf655 - Modified UnitTests/testInverseDynamicsDerivativesSimple.cpp: - Updated conf_add to use [pos(3), quat(4)] ordering - Use h=1e-6 for floating base (instead of 1e-8) - Use tolerance 1e-5 for floating base tests - Joint.h remains with [pos(3), quat(4)] ordering (e1bf655 baseline) Results: - testInverseDynamicsDerivativesSimple: 4/4 PASSED (including MiniCheetahQuaternion) - testRigidBodyDynamicsAlgosDerivatives: 14/14 PASSED
pwensing
reviewed
May 27, 2026
pwensing
requested changes
May 27, 2026
Member
pwensing
left a comment
There was a problem hiding this comment.
Looks good. All pretty minor, with the exception of avoiding a few temporaries that lead to dynamic allocations in the main derivatives loop. Let me know via slack after you've responded to the lot.
Member
|
@nicholasadr Please see the specific call outs where it would be good to get your input. |
pwensing
reviewed
May 27, 2026
pwensing
reviewed
May 27, 2026
… declarations of alpha, beta, Sdotqd_q, and st_dq outside the loop
This reverts commit a8ca9f1.
This reverts commit 5f32d1a.
…:runtime_error to CasadiDerivatives.h, and refactored Spatial.h utils to accumulate or write diriectly to avoid returning by value
…le large block-diagonal matrices, which required some added utilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.