Open mpetersen94 opened 4 years ago
My reason for pushing this (as well as pushing the new joints) is that we are trying to model a rope and we want to make the model behave in a physically reasonable way.
@mpetersen94 it's not obvious to me that a joint limit would be the right way to impose "rope like" behavior on a U-joint connected chain of bodies. Joint limits have the property that they provide zero force until you reach the limit. I don't know much about rope models, but I'm guessing they would resist any bending, likely in some nonlinear way that looks joint limit-ish at the extremes. Have you thought about that? It would be straightforward to add a model like that via a custom ForceElement, applied to the joint but not specified as part of the joint definition.
Separately from rope modeling though, I think GetOnePosition() and GetOneVelocity() should allow for a joint_dof to be provided like AddInOneForce() does. The reset of the Joint API seems right for multi-dof joints -- for example all the setting and getting of limits uses a VectorX so can deal with any number of dofs. Likely we should also have GetPositions() and GetVelocities() that return VectorX's for those as well.
Once #13055 merges, Drake will support a multi degree of freedom joint where joint limits are physically meaningful. However, the way joint limits are enforced in MultibodyPlant, assumes that they are only on one dof joints. The
AddJointLimitsPenaltyForces
method usesjoint.GetOnePosition()
,joint.GetOneVelocity()
andjoint.AddInOneForce()
. The last of these methods enables selecting among the joints dof's but the other two throw an error if the joint has more that one dof.I see two options to fix this:
GetOnePosition()
andGetOneVelocity()
to support multi-dof joints.I would love to have anyone who has thoughts on the best way to implement this add comments, especially @sherm1 and @amcastro-tri .
My reason for pushing this (as well as pushing the new joints) is that we are trying to model a rope and we want to make the model behave in a physically reasonable way.
Possibly related #12942