DAIRLab / dair_pll

DAIRLab Physics-based Learning Library
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

Fix inertia-related bugs #2

Closed ebianchi closed 1 year ago

ebianchi commented 1 year ago

This pull request fixes a couple of inertia-related bugs in the original code:

  1. The inertia parameter attributes listed in urdf_utils.py correctly defines _IYY = "iyy" instead of the original erroneous definition _IYY = "ixy".
  2. The inertia theta representation expects inertial parameters about the body frame origin instead of the center of mass, as the code originally expected. To make these consistent, this pull request includes a change in inertia.py to define I_BBcm_B properly (requiring a Shift() and CalcRotationalInertia()) as well as a change in multibody_terms.py (using MakeFromCentralInertia()).
ebianchi commented 1 year ago

Adding in another inertia-related comment here, without the accompanying code changes to implement. I find the drake versus drake_spatial_inertia inertial parameter definitions to be confusing, since their names seem to indicate the opposite of their current definitions. I would expect drake_spatial_inertia to be a Drake pydrake.multibody.tree.SpatialInertia object, and for drake parameters to not. Currently this is the opposite way around.

This would be a straightforward set of changes to make that I could easily add into this PR. However given this is a stylistic choice rather than a bug, I'll leave this decision to @mshalm as the original architect of this code to approve or not.