Aikido
aikido::planner::SingleProblemPlanner< Derived, ProblemT > Class Template Reference

SingleProblemPlanner is a base class for any concrete planner that are not a CompositePlanner. More...

#include <aikido/planner/SingleProblemPlanner.hpp>

Inheritance diagram for aikido::planner::SingleProblemPlanner< Derived, ProblemT >:
aikido::planner::Planner aikido::planner::dart::SingleProblemPlanner< Derived, ProblemT > aikido::planner::dart::ConfigurationToConfigurationPlanner aikido::planner::dart::PlannerAdapter< planner::ConfigurationToConfigurationPlanner, planner::dart::ConfigurationToConfigurationPlanner > aikido::planner::dart::ConfigurationToConfiguration_to_ConfigurationToConfiguration

Public Types

using SolvableProblem = ProblemT
 

Public Member Functions

 SingleProblemPlanner (statespace::ConstStateSpacePtr stateSpace, common::RNG *rng=nullptr)
 Constructs from a state space. More...
 
bool canSolve (const Problem &problem) const final override
 Returns true if this planner can solve problem. More...
 
trajectory::TrajectoryPtr plan (const Problem &problem, Result *result=nullptr) final override
 Solves problem returning the result to result. More...
 
- Public Member Functions inherited from aikido::planner::Planner
 Planner (statespace::ConstStateSpacePtr stateSpace, common::RNG *rng=nullptr)
 Constructs from a state space. More...
 
virtual ~Planner ()=default
 Default destructor. More...
 
statespace::ConstStateSpacePtr getStateSpace () const
 Returns const state space. More...
 
common::RNGgetRng ()
 Returns RNG. More...
 

Additional Inherited Members

- Protected Attributes inherited from aikido::planner::Planner
statespace::ConstStateSpacePtr mStateSpace
 State space associated with this planner. More...
 
std::unique_ptr< common::RNGmRng
 RNG the planner uses. More...
 

Detailed Description

template<typename Derived, typename ProblemT>
class aikido::planner::SingleProblemPlanner< Derived, ProblemT >

SingleProblemPlanner is a base class for any concrete planner that are not a CompositePlanner.

This is a curiously recurring template pattern implementation to avoid the same implementation of canSolve() and plan() across concrete planners. By inheriting this class the concrete planner doesn't need to implement those virtual functions.

Template Parameters
DerivedConcrete planner type.
ProblemTProblem type the concrete planner is associated with.

Member Typedef Documentation

◆ SolvableProblem

template<typename Derived , typename ProblemT >
using aikido::planner::SingleProblemPlanner< Derived, ProblemT >::SolvableProblem = ProblemT

Constructor & Destructor Documentation

◆ SingleProblemPlanner()

template<typename Derived , typename ProblemT >
aikido::planner::SingleProblemPlanner< Derived, ProblemT >::SingleProblemPlanner ( statespace::ConstStateSpacePtr  stateSpace,
common::RNG rng = nullptr 
)
explicit

Constructs from a state space.

Parameters
[in]stateSpaceState space that this planner associated with.
[in]rngRNG that planner uses. If nullptr, a default is created.

Member Function Documentation

◆ canSolve()

template<typename Derived , typename ProblemT >
bool aikido::planner::SingleProblemPlanner< Derived, ProblemT >::canSolve ( const Problem problem) const
finaloverridevirtual

Returns true if this planner can solve problem.

Implements aikido::planner::Planner.

◆ plan()

template<typename Derived , typename ProblemT >
trajectory::TrajectoryPtr aikido::planner::SingleProblemPlanner< Derived, ProblemT >::plan ( const Problem problem,
Result result = nullptr 
)
finaloverridevirtual

Solves problem returning the result to result.

Parameters
[in]problemPlanning problem to be solved by the planner.
[out]resultResult of planning procedure.

Implements aikido::planner::Planner.