Open hongkai-dai opened 3 weeks ago
It seems like to me if the check and advice were done in the constraint object constructor, instead of the IK wrapper sugar, that would catch more mistakes (for users who create the constraint objects directly).
In fact, I see that they already have a CheckPlantIsConnectedToSceneGraph
helper call, so I'm not sure why we're copy-pasting that logic again. Wasn't the bug just that the error message from CheckPlantIsConnectedToSceneGraph
needs a bit more text?
The first thing I would try is using troubleshooting.md
instead of putting so many words into the exception message.
We already have this FAQ entry: https://drake.mit.edu/troubleshooting.html#mbp-unconnected-query-object-port
Maybe we could add more detail there related to IK (including all of the kinds of examples you gave above), and add the hyperlink to the exception message instead of lots of text?
If the IK constructor doesn't take in the plant context, or takes in the wrong plant context, and imposes distance related constraint, then warn the user about the plant_context in the constructor.
Resolves #21541
This change is![Reviewable](https://reviewable.io/review_button.svg)