RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

VPolytope::GetMinimalRepresentation Throws for Degenerate VPolytopes #22218

Closed cohnt closed 1 day ago

cohnt commented 1 day ago

What happened?

Because this method directly calls QHull, we run into similar issues to those encountered in #19717. In all of the following cases, we are throwing an error (which is not documented in doxygen). But also, we I can fix this pretty easily.

QHull doesn't support ambient dimension 1:

from pydrake.all import VPolytope
VPolytope([[1]]).GetMinimalRepresentation()

QHull needs at least dimension+1 points:

from pydrake.all import VPolytope
v = VPolytope([[0, 1], [0, 1]]).GetMinimalRepresentation()

QHull doesn't like when points lie along an affine subspace:

from pydrake.all import VPolytope
v = VPolytope([[0, 1, 2], [0, 1, 2]]).GetMinimalRepresentation()

Version

No response

What operating system are you using?

No response

What installation option are you using?

No response

Relevant log output

No response