RobotLocomotion / drake

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

Floating Point Exception in GcsTrajectoryOptimization::GetGraphvizString #20859

Closed cohnt closed 2 months ago

cohnt commented 9 months ago

What happened?

Occasionally, when calling GcsTrajectoryOptimization::GetGraphvizString, my python code is crashing with the output Floating point exception. I've constructed a self-contained example here to help reproduce the bug (note -- uses Mosek to solve the GCS problem).

Version

b0db189590c722f9ec7e1df77116a556e3413a32

What operating system are you using?

Unknown / Other, Ubuntu 22.04

What installation option are you using?

compiled from source code using CMake

Relevant log output

0x00007fffc1f1c350 in std::_Hashtable<unsigned long, std::pair<unsigned long const, int>, std::allocator<std::pair<unsigned long const, int> >, std::__detail::_Select1st, std::equal_to<unsigned long>, std::hash<unsigned long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::find(unsigned long const&) const () from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/common/../../../../libdrake.so
(gdb) bt
#0  0x00007fffc1f1c350 in std::_Hashtable<unsigned long, std::pair<unsigned long const, int>, std::allocator<std::pair<unsigned long const, int> >, std::__detail::_Select1st, std::equal_to<unsigned long>, std::hash<unsigned long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::find(unsigned long const&) const () from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/common/../../../../libdrake.so
#1  0x00007fffc2165c25 in drake::solvers::GetVariableValue(drake::symbolic::Variable const&, std::optional<std::unordered_map<unsigned long, int, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, int> > > > const&, Eigen::Ref<Eigen::Matrix<double, -1, 1, 0, -1, 1> const, 0, Eigen::InnerStride<1> > const&) ()
   from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/common/../../../../libdrake.so
#2  0x00007fffc2748ff7 in std::enable_if<is_same_v<Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1>::Scalar, drake::symbolic::Variable>, Eigen::Matrix<double, Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1>::RowsAtCompileTime, Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1>::ColsAtCompileTime, Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1>::IsRowMajor?((Eigen::StorageOptions)1) : ((Eigen::StorageOptions)0), Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1>::MaxRowsAtCompileTime, Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1>::MaxColsAtCompileTime> >::type drake::solvers::MathematicalProgramResult::GetSolution<Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<drake::symbolic::Variable, -1, 1, 0, -1, 1> > const&) const ()
   from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/common/../../../../libdrake.so
#3  0x00007fffc2897ba3 in drake::geometry::optimization::GraphOfConvexSets::GetGraphvizString[abi:cxx11](std::optional<drake::solvers::MathematicalProgramResult> const&, bool, int, bool) const ()
   from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/common/../../../../libdrake.so
#4  0x00007fff14dd43f1 in drake::planning::trajectory_optimization::GcsTrajectoryOptimization::GetGraphvizString[abi:cxx11](std::optional<drake::solvers::MathematicalProgramResult> const&, bool, int, bool) const ()
   from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/planning/__init__.cpython-310-x86_64-linux-gnu.so
#5  0x00007fff14e08474 in ?? ()
   from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/planning/__init__.cpython-310-x86_64-linux-gnu.so
#6  0x00007fff14d5ba3c in ?? ()
   from /home/tommy/opt/rlg/drake-build/install/lib/python3.10/site-packages/pydrake/planning/__init__.cpython-310-x86_64-linux-gnu.so
#7  0x00005555556ae10e in cfunction_call (func=<built-in method GetGraphvizString of PyCapsule object at remote 0x7fff1576d7d0>, 
    args=<optimized out>, kwargs=<optimized out>) at ../Objects/methodobject.c:543
#8  0x00005555556a4a7b in _PyObject_MakeTpCall (tstate=0x555555b5abd0, 
    callable=<built-in method GetGraphvizString of PyCapsule object at remote 0x7fff1576d7d0>, args=<optimized out>, 
    nargs=<optimized out>, keywords=('show_slack',)) at ../Objects/call.c:215
#9  0x00005555556bcacb in _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>, args=0x7ffff752a5a0, 
    callable=<built-in method GetGraphvizString of PyCapsule object at remote 0x7fff1576d7d0>, tstate=0x555555b5abd0)
    at ../Include/cpython/abstract.h:112
#10 _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>, args=0x7ffff752a5a0, 
    callable=<built-in method GetGraphvizString of PyCapsule object at remote 0x7fff1576d7d0>, tstate=0x555555b5abd0)
    at ../Include/cpython/abstract.h:99
#11 method_vectorcall (method=<optimized out>, args=0x7ffff752a5a8, nargsf=<optimized out>, kwnames=<optimized out>)
    at ../Objects/classobject.c:53
#12 0x000055555569853c in _PyObject_VectorcallTstate (kwnames=('show_slack',), nargsf=<optimized out>, args=<optimized out>, 
    callable=<method at remote 0x7fff16b72dc0>, tstate=0x555555b5abd0) at ../Include/cpython/abstract.h:114
#13 PyObject_Vectorcall (kwnames=('show_slack',), nargsf=<optimized out>, args=<optimized out>, 
    callable=<method at remote 0x7fff16b72dc0>) at ../Include/cpython/abstract.h:123
#14 call_function (kwnames=('show_slack',), oparg=<optimized out>, pp_stack=<synthetic pointer>, trace_info=0x7fffffffd2e0, 
    tstate=<optimized out>) at ../Python/ceval.c:5893
#15 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at ../Python/ceval.c:4231
#16 0x00005555556939c6 in _PyEval_EvalFrame (throwflag=0, 
    f=Frame 0x7ffff752a440, for file /home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py, line 39, in <module> (), tstate=0x555555b5abd0) at ../Include/internal/pycore_ceval.h:46
#17 _PyEval_Vector (tstate=0x555555b5abd0, con=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=<optimized out>, 
    kwnames=<optimized out>) at ../Python/ceval.c:5067
#18 0x0000555555789256 in PyEval_EvalCode (co=<code at remote 0x7ffff72d0450>, 
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py') at remote 0x7ffff73ddc90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7594950>, '__file__': '/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', '__cached__': None, 'np': <module at remote 0x7ffff72fc040>, 'pickle': <module at remote 0x7ffff7379df0>, 'GcsTrajectoryOptimization': <pybind11_type(__init__=<instancemethod at remote 0x7fff1576d6f0>, __doc__='GcsTrajectoryOptimization implements a simplified motion planning\noptimization problem introduced in the paper `"Motion Planning around\nObstacles with Convex Optimization"\n<https://arxiv.org/abs/2205.04422>`_ by Tobia Marcucci, Mark Petersen,\nDavid von Wrangel, Russ Tedrake.\n\nInstead of using the full time-sca...(truncated), locals=<optimized out>) at ../Python/ceval.c:1134
#19 0x00005555557b4108 in run_eval_code_obj (tstate=0x555555b5abd0, co=0x7ffff72d0450, 
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py') at remote 0x7ffff73ddc90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7594950>, '__file__': '/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', '__cached__': None, 'np': <module at remote 0x7ffff72fc040>, 'pickle': <module at remote 0x7ffff7379df0>, 'GcsTrajectoryOptimization': <pybind11_type(__init__=<instancemethod at remote 0x7fff1576d6f0>, __doc__='GcsTrajectoryOptimization implements a simplified motion planning\noptimization problem introduced in the paper `"Motion Planning around\nObstacles with Convex Optimization"\n<https://arxiv.org/abs/2205.04422>`_ by Tobia Marcucci, Mark Petersen,\nDavid von Wrangel, Russ Tedrake.\n\nInstead of using the full time-sca...(truncated), 
    locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py') at remote 0x7ffff73ddc90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7594950>, '__file__': '/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', '__cached__': None, 'np': <module at remote 0x7ff--Type <RET> for more, q to quit, c to continue without paging--c
ff72fc040>, 'pickle': <module at remote 0x7ffff7379df0>, 'GcsTrajectoryOptimization': <pybind11_type(__init__=<instancemethod at remote 0x7fff1576d6f0>, __doc__='GcsTrajectoryOptimization implements a simplified motion planning\noptimization problem introduced in the paper `"Motion Planning around\nObstacles with Convex Optimization"\n<https://arxiv.org/abs/2205.04422>`_ by Tobia Marcucci, Mark Petersen,\nDavid von Wrangel, Russ Tedrake.\n\nInstead of using the full time-sca...(truncated)) at ../Python/pythonrun.c:1291
#20 0x00005555557ad9cb in run_mod (mod=<optimized out>, filename=<optimized out>, globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py') at remote 0x7ffff73ddc90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7594950>, '__file__': '/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', '__cached__': None, 'np': <module at remote 0x7ffff72fc040>, 'pickle': <module at remote 0x7ffff7379df0>, 'GcsTrajectoryOptimization': <pybind11_type(__init__=<instancemethod at remote 0x7fff1576d6f0>, __doc__='GcsTrajectoryOptimization implements a simplified motion planning\noptimization problem introduced in the paper `"Motion Planning around\nObstacles with Convex Optimization"\n<https://arxiv.org/abs/2205.04422>`_ by Tobia Marcucci, Mark Petersen,\nDavid von Wrangel, Russ Tedrake.\n\nInstead of using the full time-sca...(truncated), locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py') at remote 0x7ffff73ddc90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7594950>, '__file__': '/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', '__cached__': None, 'np': <module at remote 0x7ffff72fc040>, 'pickle': <module at remote 0x7ffff7379df0>, 'GcsTrajectoryOptimization': <pybind11_type(__init__=<instancemethod at remote 0x7fff1576d6f0>, __doc__='GcsTrajectoryOptimization implements a simplified motion planning\noptimization problem introduced in the paper `"Motion Planning around\nObstacles with Convex Optimization"\n<https://arxiv.org/abs/2205.04422>`_ by Tobia Marcucci, Mark Petersen,\nDavid von Wrangel, Russ Tedrake.\n\nInstead of using the full time-sca...(truncated), flags=<optimized out>, arena=<optimized out>) at ../Python/pythonrun.c:1312
#21 0x00005555557b3e55 in pyrun_file (fp=fp@entry=0x555555b5cfa0, filename=filename@entry='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', start=start@entry=257, globals=globals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py') at remote 0x7ffff73ddc90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7594950>, '__file__': '/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', '__cached__': None, 'np': <module at remote 0x7ffff72fc040>, 'pickle': <module at remote 0x7ffff7379df0>, 'GcsTrajectoryOptimization': <pybind11_type(__init__=<instancemethod at remote 0x7fff1576d6f0>, __doc__='GcsTrajectoryOptimization implements a simplified motion planning\noptimization problem introduced in the paper `"Motion Planning around\nObstacles with Convex Optimization"\n<https://arxiv.org/abs/2205.04422>`_ by Tobia Marcucci, Mark Petersen,\nDavid von Wrangel, Russ Tedrake.\n\nInstead of using the full time-sca...(truncated), locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py') at remote 0x7ffff73ddc90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7594950>, '__file__': '/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', '__cached__': None, 'np': <module at remote 0x7ffff72fc040>, 'pickle': <module at remote 0x7ffff7379df0>, 'GcsTrajectoryOptimization': <pybind11_type(__init__=<instancemethod at remote 0x7fff1576d6f0>, __doc__='GcsTrajectoryOptimization implements a simplified motion planning\noptimization problem introduced in the paper `"Motion Planning around\nObstacles with Convex Optimization"\n<https://arxiv.org/abs/2205.04422>`_ by Tobia Marcucci, Mark Petersen,\nDavid von Wrangel, Russ Tedrake.\n\nInstead of using the full time-sca...(truncated), closeit=closeit@entry=1, flags=0x7fffffffd588) at ../Python/pythonrun.c:1208
#22 0x00005555557b3338 in _PyRun_SimpleFileObject (fp=0x555555b5cfa0, filename='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', closeit=1, flags=0x7fffffffd588) at ../Python/pythonrun.c:456
#23 0x00005555557b2f83 in _PyRun_AnyFileObject (fp=0x555555b5cfa0, filename='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', closeit=1, flags=0x7fffffffd588) at ../Python/pythonrun.c:90
#24 0x00005555557a5a5e in pymain_run_file_obj (skip_source_first_line=0, filename='/home/tommy/Documents/programming/work/rlg/graphs-of-geodesically-convex-sets/bimanual-ggcs-analytic-ik/notebooks/tmp.py', program_name='/usr/bin/python') at ../Modules/main.c:353
#25 pymain_run_file (config=0x555555b3e840) at ../Modules/main.c:372
#26 pymain_run_python (exitcode=0x7fffffffd584) at ../Modules/main.c:587
#27 Py_RunMain () at ../Modules/main.c:666
#28 0x000055555577c02d in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at ../Modules/main.c:720
#29 0x00007ffff7c29d90 in __libc_start_call_main (main=main@entry=0x55555577bff0 <main>, argc=argc@entry=2, argv=argv@entry=0x7fffffffd798) at ../sysdeps/nptl/libc_start_call_main.h:58
#30 0x00007ffff7c29e40 in __libc_start_main_impl (main=0x55555577bff0 <main>, argc=2, argv=0x7fffffffd798, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd788) at ../csu/libc-start.c:392
#31 0x000055555577bf25 in _start ()
sherm1 commented 9 months ago

Assigned to Russ for disposition.