Simulation, optimization and control of robotic and bio-mechanical systems depend on a mathematical model description, typically a rigid-body system connected by joints, for which efficient algorithms to compute the forward or inverse dynamics exist. Models that e.g.\ include spring-damper systems are subject to both kinematic and loop constraints. Gradient-based optimization and control methods require derivatives of the dynamics, often approximated by FD. However, they greatly benefit from accurate gradients, which promote faster convergence, smaller iteration counts, improved handling of nonlinearities or ill-conditioning of the problem formulations, which are particularly observed when kinematic constraints are involved. In this article, we apply AD to propagate sensitivities through dynamics algorithms. To this end, we augment the computational graph of these algorithms with derivative information. We provide analytic derivatives for elementary operations, in particular matrix factorizations of the descriptor form of the equation of motions with additional constraints, which yields a very efficient derivative evaluation for constrained dynamics. The proposed approach is implemented within the free software package Rigid Body Dynamics Library (RBDL), which heavily employs so-called Spatial Transformations in its implementation of the dynamics algorithms. Thus, manipulations of Spatial Transformations are treated as elementary operations. The efficiency is improved further by sparsity exploitation. We validate and benchmark the implementation against its FD counterpart for a lifting motion of a human model.
Citation
accepted