ipab-slmc / exotica

Extensible Optimization Framework
https://ipab-slmc.github.io/exotica
BSD 3-Clause "New" or "Revised" License
150 stars 70 forks source link

PRM::grow_roadmap and others broken #456

Open wxmerkt opened 5 years ago

wxmerkt commented 5 years ago

This is directly related to #445 and #444:

Backtrace:


[New Thread 0x7fffb3fff700 (LWP 17198)]
[ INFO] [1545135698.834008741]: Loading robot model 'lwr'...

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffcbd706a0 in ompl::base::Planner::isSetup() const () from /opt/ros/kinetic/lib/x86_64-linux-gnu/libompl.so.12
(gdb) backtrace
#0  0x00007fffcbd706a0 in ompl::base::Planner::isSetup() const () from /opt/ros/kinetic/lib/x86_64-linux-gnu/libompl.so.12
#1  0x00007fffcbd9a063 in ompl::geometric::PRM::growRoadmap(ompl::base::PlannerTerminationCondition const&) () from /opt/ros/kinetic/lib/x86_64-linux-gnu/libompl.so.12
#2  0x00007fffcbd9a16c in ompl::geometric::PRM::growRoadmap(double) () from /opt/ros/kinetic/lib/x86_64-linux-gnu/libompl.so.12
#3  0x00007fffcc2f2fa2 in exotica::PRM::GrowRoadmap (this=<optimised out>, t=<optimised out>)```
wxmerkt commented 5 years ago

@VladimirIvan @christian-rauch The source of this bug is that the state space and simple setup aren't finalised ("setup") until the first call of Solve. Thus, growing a roadmap before the first solve has been called (as in example_prm.py) causes a segmentation fault. There are a few issues that prevent easy fixes:

(a) We moved to this in order to be able to set correct bounds for the problem. That was broken. (b) Previously when we first created problems and solvers specifically, we could change the problem before calling specifyProblem to the solver - which circumvented this issue. Now the standard way is to use loadSolver which specifies the problem automatically. (c) Calling setup manually after checking isSetup is also crashing :'( (d) We cannot reset the state space without resetting the simple setup - which is resetting everything.

VladimirIvan commented 5 years ago

(d) We cannot reset the state space without resetting the simple setup - which is resetting everything.

Does this go away if you specify the same problem twice (conflict with (c)...)? I wouldn't mind if we have to reset the whole simple setup during this operation.