In order to implement a new motion planner the following rules need to be followed:
#include "ompl/base/Planner.h" namespace ompl { class myNewPlanner : public base::Planner { public: myNewPlanner(const base::SpaceInformationPtr &si) : base::Planner(si, "the planner's name") { // the type of goals this planner can handle type_ = base::PLAN_TO_GOAL_REGION; } virtual ~myNewPlanner(void) { // free any allocated memory } virtual bool solve(const base::PlannerTerminationCondition &ptc) { // get problem definition from pdef_ // get input states with pis_ // call routines from si_ // periodically check if ptc() returns true. // if it does, terminate planning // compute a valid motion plan // set it with pdef_->getGoal()->setSolutionPath() return pdef_->getGoal()->isAchieved(); } virtual void clear(void) { // clear the data structures } virtual void getPlannerData(PlannerData &data) const { // fill data with the states and edges that were created // in the exploration data structure } }; }