API Overview

User code StateSpaceRepresents the state space in which planning is performed; implements topology-specific functions: distance, interpola- tion, state (de)allocation. StateSamplerImplements uniform and Gaussian sampling of states for a specific StateSpace. ProjectionEvaluatorComputes projections from states of a specific State- Space to a low-dimensional Euclidean space. PathRepresentation of a path; used to represent a solution to a planning problem. GoalRepresentation of a goal. StateValidityCheckerDecides whether a given state from a specific StateSpace is valid. SpaceInformationProvides routines typically used by motion planners; combines the functionality of classes it depends on. MotionValidatorProvides the ability to check the validity of path segments using the interpolation provided by the StateSpace. ValidStateSamplerProvides the ability to sample valid states. PlannerSolves a motion planning problem. SimpleSetupProvides a simple way of setting up all needed classes without limitingfunctionality. ProblemDefinitionSpecifies the instance of the planning problem; requires definition of start states and a goal. A B User must instantiate this class.User must instantiate this class unless SimpleSetup is used.User can instantiate this class, but defaults are provided. only when planning with differential constraints ControlSamplerImplements sampling of controlsfor a specific ControlSpace. ControlSpaceRepresents the controlspace the planner uses torepresent inputs to thesystem being planned for. DirectedControlSamplerSample controls that take the system towards a desired state. StatePropagatorReturns the state obtained by applying a control to some arbitrary initial state. OptimizationObjective Encodes a path cost that is used by optimizing planners.

The class ownership diagram above shows the relationship between the essential base classes in OMPL. For example, SpaceInformation owns a StateSpace; Planner does not own SpaceInformation, although a Planner does know about the SpaceInformation, and uses provided functionality. Users are encouraged to use the SimpleSetup class (ompl::geometric::SimpleSetup or ompl::control::SimpleSetup). With this class, it is only necessary to instantiate a ompl::base::StateSpace object, a ompl::control::ControlSpace object (when planning with differential constraints, i.e., planning with controls), and a ompl::base::StateValidityChecker object. Many common state spaces have already been implemented as derived StateSpace classes. See a list here.

The ompl::base::StateValidityChecker is problem-specific, so no default implementation is available. See this document for more information on state validity checking. For more advanced definitions of goals, see this document.

Doxygen-generated documentation

Thread safety

All static, non-member or const member functions are thread safe. Calling member functions that are not const in multiple threads simultaneously is unsafe and locks should be used.

Memory management

For all base classes Class, a ClassPtr type is defined as well. ClassPtr is in fact a shared pointer for Class:

class Class;
using ClassPtr = std::shared_ptr<Class>;

The code above is generated by the OMPL_CLASS_FORWARD macro defined in ompl/util/ClassForward.h:


Often the user is required to operate with *Ptr variables, in order to ensure all memory is freed at the termination of the program without explicitly calling delete. For some classes internal to the library, a C-style pointer is maintained instead of the *Ptr variable to avoid cyclic dependencies (which prevent memory de-allocation).