Skip to content

New/fixing derivs no benchmarks#100

Open
DVolpi256 wants to merge 170 commits into
mainfrom
new/fixing_derivs_no_benchmarks
Open

New/fixing derivs no benchmarks#100
DVolpi256 wants to merge 170 commits into
mainfrom
new/fixing_derivs_no_benchmarks

Conversation

@DVolpi256
Copy link
Copy Markdown

  • 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.

DVolpi256 and others added 30 commits October 23, 2025 13:28
Has temporary variables for the backward pass as well. Comments are made for new functions that need to be implemented.
… 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
… 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.
… Cheetah. Examining how to get the complex step working and whether testRigidBodyDynamicsAlgosDerivatives is now broken.
- 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
Comment thread src/Dynamics/ClusterTreeModel.cpp Outdated
Copy link
Copy Markdown
Member

@pwensing pwensing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pwensing
Copy link
Copy Markdown
Member

@nicholasadr Please see the specific call outs where it would be good to get your input.

Comment thread src/Dynamics/ClusterTreeDynamics.cpp Outdated
Comment thread include/grbda/Dynamics/Nodes/TreeNode.h
DVolpi256 added 19 commits May 27, 2026 14:32
… declarations of alpha, beta, Sdotqd_q, and st_dq outside the loop
…: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.
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.

3 participants