Closed RussTedrake closed 2 years ago
It turns out that this error can crop up in a much more insidious way, too. If someone constructs a MultibodyPlant
that has a floating base and passes it directly to our trajectory optimization codes (without explicitly adding unit quaternion constraints), then the optimizer can easily drive the solution into these singular states. That is much harder to debug, and explains some of the issues that have been coming up in class projects.
Because this is an awful trap to lay for users, I will raise this to priority medium.
FYI tangentially related to #14800.
@mitiguy do you want to add this to your list of make-Drake-error-messages-mean-something tasks?
Yes -- please assign me.
The following code
fails because the state is set to zero, despite it having a quaternion floating base.
But the error message is
which leads people to debug in all of the wrong places.
Note: I had mentioned this in https://github.com/RobotLocomotion/drake/issues/16992#issuecomment-1114311140, but have now found this to be the root cause and a minimal reproduction.