drake
drake copied to clipboard
Parse closed kinematic chains from SDF (and perhaps also URDF)
SAP now supports constraints, but currently users can only define those constraints programmatically.
Closed kinematic chains are a common feature in robots (e.g. Cassie, or in many underactuated hands). We should support parsing a robot with a closed kinematic chain directly from SDF and/or URDF. The specification in URDF is such that one cannot define a closed chain without additional tags, but in SDF it is possible to define a closed chain just by adding the already defined links and joints. Presumably we throw an error in this case, but I have not verified that.
We used to have a Drake-specific "loop_joint" tag. You can still find vestiges of it in our codebase; the URDF parser even reports Error(*node, "loop joints are not supported in MultibodyPlant"); if it encounters one. I believe @sherm1 feels that it's better for the user to be able to decide where the mechanism should be split and closed with a constraint (vs the true joints), and that it's better to split in the middle of a link and then have a constraint which welds the link back together (vs a lower-DOF constraint implemented at a joint). I am ok with requiring a custom tag.
A victory condition here would be to have the four_bar.sdf and even strandebeest use constraints without having to add them programmatically. They should be specified in the robot description file.