Closed ebianchi closed 1 year ago
The latest commit (e470600) corrected a bug in the pi_o
to pi_cm
and pi_cm
to pi_o
conversions which turned positive any negative I_xy, I_xz, I_yz
off-diagonal moments of inertia. None of my original test systems matched this scenario, so I had missed it earlier. Thanks to some more extensive testing and @mposa for identifying this behavior.
I addressed and/or responded to each of the comments. The results of some lingering conversations include:
drake_to_pi_o
's implementation relying on Drake's functionality instead of as a pass-through of other PLL methods: let me know if you'd prefer the pass-through implementation instead.pydrake.multibody.tree.SpatialInertia
object: After some exploration, I couldn't find a way that would avoid an element-by-element conversion like in the current implementation.inertia.py
autodocs, I took care of anything that triggered a warning and/or clearly was rendered in an unintentional way, without changing the contents of that other documentation.
The previous PR with inertial parameter fixes did not sufficiently address the disparity in how inertial parameters in
pi
format require moments of inertia w.r.t. centers of mass, while inertial parameters intheta
format require moments of inertia w.r.t. body origins. That previous PR managed to load inertial parameters in a way that made the originalpi
parameters match those provided in the URDF. However, it neglected to convert to/fromtheta
format accurately, givenpi
format did not contain the correct moments of inertia expected by the Rucker and Wensingpi
-to-theta
conversion.To address this discrepancy, this PR proposes to replace any mention of
pi
parameters with one of two alternatives:pi_o
orpi_cm
, both in the originalpi
format but with moments of inertia expressed w.r.t. the body origin or the body center of mass, respectively. Inertial parameters can be converted between these two viaInertialParameterConverter.pi_o_to_pi_cm()
andInertialParameterConverter.pi_cm_to_pi_o()
, which perform the conversions using the Parallel Axis Theorem.Thus,
theta
format is calculated via Rucker and Wensing's method, starting frompi_o
format.This PR primarily involves the additional necessary functionality in
inertia.py
to represent and convert to/from the new inertial parameter formats. Secondary filesmultibody_terms.py
andurdf_utils.py
feature variable name changes to clarifypi_o
versuspi_cm
format and function call changes to reference new methods ininertia.py
.