ompl/ompl — pull request #11 by davetcoleman (2014-06-09 08:52:21+00:00)
Title: Track planner name in solution

I don't think we should merge this yet since I haven't finalized what exactly I will need, but basically I need to add the ability for OMPL to tell me which planner generated the solution when multiple planners are sharing the same ``ProblemDefintion`` and adding multiple potential solutions. Currently, when you query for the best solution (shortest path that is not approximate) it only gives you the path, but can't tell you where it came from.

For the Lightning Framework implementation, I need to know if the path is from a database or planned from scratch. I can imagine other uses for this, too, such as automatically choosing the best planners to spawn into threads, and maybe benchmarking.

I'm not super happy with the function I added called ``const std::string& getSolutionPlannerName(void) const;`` but its the simplest change to give me the functionality I want.

I tried instead to return the entire best solution, instead of just the best solution path, but the problem I kept running into is that the vector of solutions is not wrapped in boost pointers, and I didn't want to make a copy of the solution because I also needed to be able to pass a NULL return value if there is no solution. I'm open to debate on this.

At the bottom I show an example with TRRT of the small change that can (and should) be optionally added to all the planners.

I also added a note in the code:
``
/// \todo Create a second constructor which requires plannerName, and make this one deprecated so as to encourage OMPL devs to pass a name?
``