drake icon indicating copy to clipboard operation
drake copied to clipboard

Getters for MultibodyConstraintId for constraints added by the Parser

Open RussTedrake opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. #21397 added MultibodyPlant::RemoveJoint, but throws if there are any constraints registered with the plant. We have MultibodyPlant::RemoveConstraint(MultibodyConstraintId), but if constraints are added by the Parser, then there is no way from python to get the MultibodyConstraintId.

Describe the solution you'd like The minimal API which would unblock this issue is to add std::vector<MultibodyConstraintId> MultibodyPlant::GetConstraintIds().

Describe alternatives you've considered The existing accessor methods, like get_coupler_constraint_specs, could serve this purpose, but they are currently marked as internal and are not bound in pydrake. We could change this decision. Even if we implement GetConstraintIds(), we don't currently have any pydrake methods to introspect even what type of constraint is associated with the MultibodyConstraintId.

We could add MultibodyPlant::RemoveAllConstraints().

cc @amcastro-tri , @joemasterjohn

RussTedrake avatar May 25 '24 02:05 RussTedrake