Aikido
SingleProblemPlanner-impl.hpp
Go to the documentation of this file.
1 #ifndef AIKIDO_PLANNER_DETAIL_SINGLEPROBLEMPLANNER_IMPL_HPP_
2 #define AIKIDO_PLANNER_DETAIL_SINGLEPROBLEMPLANNER_IMPL_HPP_
3 
4 #include <utility>
5 
7 
8 namespace aikido {
9 namespace planner {
10 
11 //==============================================================================
12 template <typename Derived, typename ProblemT>
15  : Planner(std::move(stateSpace), std::move(rng))
16 {
17  // Do nothing
18 }
19 
20 //==============================================================================
21 template <typename Derived, typename ProblemT>
23  const Problem& problem) const
24 {
25  return problem.getType() == SolvableProblem::getStaticType();
26 }
27 
28 //==============================================================================
29 template <typename Derived, typename ProblemT>
31  const Problem& problem, Result* result)
32 {
33  if (!canSolve(problem))
34  return nullptr;
35 
36  assert(dynamic_cast<const SolvableProblem*>(&problem));
37 #ifndef NDEBUG // Debug mode
38  if (result)
39  {
40  assert(result && dynamic_cast<typename Derived::Result*>(result));
41  }
42 #endif
43 
44  return static_cast<Derived*>(this)->plan(
45  static_cast<const typename Derived::SolvableProblem&>(problem),
46  static_cast<typename Derived::Result*>(result));
47 }
48 
49 } // namespace planner
50 } // namespace aikido
51 
52 #endif // AIKIDO_PLANNER_DETAIL_SINGLEPROBLEMPLANNER_IMPL_HPP_
aikido::planner::Problem::getType
virtual const std::string & getType() const =0
Returns type of this planning problem.
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::statespace::ConstStateSpacePtr
std::shared_ptr< const StateSpace > ConstStateSpacePtr
Definition: StateSpace.hpp:15
aikido::planner::SingleProblemPlanner::SingleProblemPlanner
SingleProblemPlanner(statespace::ConstStateSpacePtr stateSpace, common::RNG *rng=nullptr)
Constructs from a state space.
Definition: SingleProblemPlanner-impl.hpp:13
aikido::trajectory::TrajectoryPtr
std::shared_ptr< Trajectory > TrajectoryPtr
Definition: Trajectory.hpp:13
SingleProblemPlanner.hpp
aikido::planner::SingleProblemPlanner< ConfigurationToEndEffectorOffsetPlanner, ConfigurationToEndEffectorOffset >::SolvableProblem
ConfigurationToEndEffectorOffset SolvableProblem
Definition: SingleProblemPlanner.hpp:25
aikido::common::RNG
Implementation of the C++11 "random engine" concept that uses virtual function calls to erase the typ...
Definition: RNG.hpp:24
aikido::planner::Planner
Base class for a meta-planner.
Definition: Planner.hpp:17
aikido::planner::Problem
Base class for various planning problems.
Definition: Problem.hpp:13
aikido::planner::dart::SingleProblemPlanner
Base planner class for all DART single problem planners.
Definition: SingleProblemPlanner.hpp:14
aikido::planner::Planner::Result
Base class for planning result of various planning problems.
Definition: Planner.hpp:58