KrisLibrary  1.0.0
Public Types | Public Member Functions | List of all members
MotionPlannerInterface Class Referenceabstract

An abstract class for a sample-based motion planner. More...

#include <AnyMotionPlanner.h>

Inheritance diagram for MotionPlannerInterface:
BiRRTInterface FMMInterface PiggybackMotionPlanner PointToSetMotionPlannerAdaptor PRMStarInterface RoadmapPlannerInterface RRTInterface SBLInterface SBLPRTInterface

Public Types

typedef Graph::UndirectedGraph< Config, std::shared_ptr< EdgePlanner > > Roadmap
 

Public Member Functions

virtual std::string Plan (MilestonePath &path, const HaltingCondition &cond)
 
virtual int PlanMore ()=0
 Performs a planning unit and returns the added milestone.
 
virtual void PlanMore (int numIters)
 Performs numIters planning units.
 
virtual int NumIterations () const =0
 Returns the number of elaped planning units.
 
virtual int NumMilestones () const =0
 Returns the number of milestones stored by the planner.
 
virtual int NumComponents () const =0
 Returns the number of connected components stored by the planner.
 
virtual bool CanAddMilestone () const
 Returns true if a milestone can currently be added.
 
virtual int AddMilestone (const Config &q)=0
 Adds a milestone, if possible. Returns an id of the milestone.
 
virtual void GetMilestone (int, Config &q)=0
 For the id of a milestone previously added, returns its configuration.
 
virtual void ConnectHint (int m)
 Manual indication that the milestone is a good candidate for connecting.
 
virtual bool ConnectHint (int ma, int mb)
 Manual indication that the milestones are good candidates for connecting.
 
virtual bool IsConnected (int ma, int mb) const =0
 Returns true if the two milestones are connected with a feasible path.
 
virtual bool IsPointToPoint () const
 
virtual bool IsOptimizing () const
 Returns true if this planner can optimize the path after the first solution.
 
virtual bool CanUseObjective () const
 
virtual void SetObjective (std::shared_ptr< ObjectiveFunctionalBase > obj)
 Must be implemented if CanUseObjective() = true.
 
virtual bool IsLazy () const
 Returns true if this planner has lazy semantics.
 
virtual bool IsLazyConnected (int ma, int mb) const
 
virtual bool CheckPath (int ma, int mb)
 
virtual int GetClosestMilestone (const Config &q)
 Retrieve the index of a close milestone.
 
virtual void GetPath (int ma, int mb, MilestonePath &path)=0
 
virtual Real GetOptimalPath (int ma, const std::vector< int > &mb, MilestonePath &path)
 
virtual bool IsSolved ()
 For single-query planners, returns true if the start and goal are connected.
 
virtual void GetSolution (MilestonePath &path)
 
virtual void GetRoadmap (Roadmap &roadmap) const
 Returns a full-blown roadmap representation of the roadmap.
 
virtual void GetStats (PropertyMap &stats) const
 Returns some named statistics about the planner, implementation-dependent.
 

Detailed Description

An abstract class for a sample-based motion planner.

Standard single-query, feasible motion planning usage is to create a MotionPlannerInterface using a MotionPlannerFactory, then add the start and goal milestones (which have id's 0 and 1, respectively). Then, Plan(path,cond) is called, with an appropriate termination condition.

Execution can be controlled manually, e.g., call PlanMore() until IsSolved() returns true, at which point the path is retrieved using GetSolution(p).

Single-query, optimal motion planning usage is the same as Plan(), except the halting condition must be changed:

Member Function Documentation

virtual bool MotionPlannerInterface::CanUseObjective ( ) const
inlinevirtual

Returns true if this planner can handle an objective function (in SetObjective and GetOptimalPath)

Reimplemented in PRMStarInterface, RRTInterface, RoadmapPlannerInterface, ShortcutMotionPlanner, RestartMotionPlanner, PointToSetMotionPlannerAdaptor, and PiggybackMotionPlanner.

Referenced by MotionPlannerFactory::ApplyModifiers().

virtual bool MotionPlannerInterface::CheckPath ( int  ma,
int  mb 
)
inlinevirtual

If lazy semantics are used, this will check for a feasible path between two lazy-connected milestones

Must be implemented if IsLazy()=true

Reimplemented in PointToSetMotionPlannerAdaptor, and PiggybackMotionPlanner.

virtual Real MotionPlannerInterface::GetOptimalPath ( int  ma,
const std::vector< int > &  mb,
MilestonePath path 
)
inlinevirtual

Calculates a feasible, minimum cost path, starting at ma and terminating at some node in the mb set. If SetObjective was called before, the objective function is used as the cost. Otherwise, the cost is up to the planner, but is typically path length. The cost is returned.

Must be implemented if CanUseObjective() = true.

Reimplemented in PRMStarInterface, RRTInterface, RoadmapPlannerInterface, PointToSetMotionPlannerAdaptor, and PiggybackMotionPlanner.

virtual void MotionPlannerInterface::GetPath ( int  ma,
int  mb,
MilestonePath path 
)
pure virtual

Returns a feasible path between two connected milestones. If IsConnected(ma,mb)=false, this will abort.

Must be implemented if IsLazy()=true

Implemented in FMMInterface, PRMStarInterface, SBLPRTInterface, SBLInterface, BiRRTInterface, RRTInterface, RoadmapPlannerInterface, RestartMotionPlanner, PointToSetMotionPlannerAdaptor, and PiggybackMotionPlanner.

virtual void MotionPlannerInterface::GetSolution ( MilestonePath path)
inlinevirtual

For single-query planners (IsPointToPoint()=true), returns the solution path.

For multi-query planners, returns the optimal solution path.

Reimplemented in PRMStarInterface, SBLPRTInterface, RRTInterface, RoadmapPlannerInterface, ShortcutMotionPlanner, RestartMotionPlanner, PointToSetMotionPlannerAdaptor, PointToSetMotionPlanner, and PiggybackMotionPlanner.

virtual bool MotionPlannerInterface::IsLazyConnected ( int  ma,
int  mb 
) const
inlinevirtual

If lazy semantics are used, returns true if the two milestones are connected by a likely feasible path

Must be implemented if IsLazy()=true

Reimplemented in PointToSetMotionPlannerAdaptor, and PiggybackMotionPlanner.

virtual bool MotionPlannerInterface::IsPointToPoint ( ) const
inlinevirtual

Returns true if this planner is exclusively point-to-point, i.e., cannot accept additional goal nodes via AddMilestone()

Reimplemented in SBLPRTInterface, RoadmapPlannerInterface, PointToSetMotionPlannerAdaptor, PointToSetMotionPlanner, and PiggybackMotionPlanner.

std::string MotionPlannerInterface::Plan ( MilestonePath path,
const HaltingCondition cond 
)
virtual

The documentation for this class was generated from the following files: