DAIRLab / dairlib

MIT License
77 stars 27 forks source link

Get position name of MBP #57

Closed yminchen closed 4 years ago

yminchen commented 5 years ago

Currently the utility functions makeNameToPositionsMap() and makeNameToPositionsMap() of MBP do not include the floating base joints and add the fixed joints which we don't want (e.g. foot_crank_mass_left and knee_spring_left_fixed of cassie_v2.urdf). This stops example/Cassie/visualizer.cc from visualizing floating base Cassie.

Line of code: https://github.com/DAIRLab/dairlib/blob/master/multibody/multibody_utils.cc#L71 https://github.com/DAIRLab/dairlib/blob/master/multibody/multibody_utils.cc#L118

yminchen commented 5 years ago

Update: The current function does not include the fixed joints and does include the floating base joints. However, we created the names for the floating base joints ourselves for now.

Could take the joints' names from MBP once this feature is added to drake.

yminchen commented 4 years ago

The code seems to work smoothly with the current multibody_utils API.

Here is where we create the floating base names by ourselves: https://github.com/DAIRLab/dairlib/blob/e908ac072c69ee83eefb159007488749173e0492/multibody/multibody_utils.cc#L119-L126 https://github.com/DAIRLab/dairlib/blob/e908ac072c69ee83eefb159007488749173e0492/multibody/multibody_utils.cc#L188-L194