Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninformative error message when calling AddMinimumDistanceLowerBoundConstraint on InverseKinematics objec #21541

Open
wernerpe opened this issue Jun 6, 2024 · 0 comments · May be fixed by #21554
Assignees
Labels
component: planning and control Optimization-based planning and control, and search- and sampling-based planning type: feature request

Comments

@wernerpe
Copy link
Contributor

wernerpe commented Jun 6, 2024

Hi all,

I ran into an uninformative error message when trying to call ' AddMinimumDistanceLowerBoundConstraint' on an InverseKinematics object. I had incorrectly constructed the IK object without passing the plant_context (like this "ik = InverseKinematics(plant)") and subsequently called "ik.AddMinimumDistanceLowerBoundConstraint(0.01, 0.1)" which throws the error:

"ValueError: Kinematic constraint: Cannot get a valid geometry::QueryObject. Either the plant's geometry query input port is not properly connected to the SceneGraph's geometry query output port, or the plant_context_ is incorrect. Please refer to AddMultibodyPlantSceneGraph on connecting MultibodyPlant to SceneGraph."

The solution in my case was simply to pass my plant_context like so "ik = InverseKinematics(plant, plant_context)" to prevent the IK constructor from creating its own. Would it be possible to add this information to this error message? E.g.

"Kinematic constraint: Cannot get a valid geometry::QueryObject. Either the plant's geometry query input port is not properly connected to the SceneGraph's geometry query output port, or the plant_context_ is incorrect. Please refer to AddMultibodyPlantSceneGraph on connecting MultibodyPlant to SceneGraph. If this error is thrown while adding a constraint to InverseKinematics, try constructing the object while passing the plant_context in the constructor: InverseKinematics(plant, plant_context) "

Thanks!

@hongkai-dai hongkai-dai added the component: planning and control Optimization-based planning and control, and search- and sampling-based planning label Jun 7, 2024
@hongkai-dai hongkai-dai linked a pull request Jun 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: planning and control Optimization-based planning and control, and search- and sampling-based planning type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants