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().
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 haveMultibodyPlant::RemoveConstraint(MultibodyConstraintId)
, but if constraints are added by the Parser, then there is no way from python to get theMultibodyConstraintId
.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 implementGetConstraintIds()
, we don't currently have any pydrake methods to introspect even what type of constraint is associated with theMultibodyConstraintId
.We could add
MultibodyPlant::RemoveAllConstraints()
.cc @amcastro-tri , @joemasterjohn