我如何采用 MultibodyPlant 计算的梯度 w.r.t。质量、质心、惯性等?

How do I take gradients of MultibodyPlant computations w.r.t. mass, center-of-mass, inertia, etc.?

我看到了Underactuated: System Identification的当前章节和相应的notebook,目前是通过symbolics来做的。

我想尝试使用前向模式自动微分(“autodiff”通过 AutoDiffXd 等)之类的系统识别之类的东西,只是为了检查可伸缩性之类的东西,更好地感受符号和 Drake 中的 autodiff 选项等

作为使用 autodiff 进行系统识别的第一步,我如何获取 MultibodyPlant 量(例如广义力、正向动力学等)相对于惯性参数(比如质量)的梯度?


Drake 的 MultibodyPlant 公式与 Drake Systems 框架相结合,可以让您通过使用 RigidBody<T> 的参数访问器对惯性参数进行导数(通过 autodiff)给定植物的 Context<AutoDiffXd>.

请看以下教程:
https://nbviewer.jupyter.org/github/RobotLocomotion/drake/blob/nightly-release/tutorials/multibody_plant_autodiff_mass.ipynb