Aikido
Planner.hpp
Go to the documentation of this file.
1 #ifndef AIKIDO_PLANNER_PLANNER_HPP_
2 #define AIKIDO_PLANNER_PLANNER_HPP_
3 
4 #include <string>
5 
10 
11 namespace aikido {
12 namespace planner {
13 
15 
16 class Planner
18 {
19 public:
20  class Result;
21 
26  explicit Planner(
27  statespace::ConstStateSpacePtr stateSpace, common::RNG* rng = nullptr);
28 
30  virtual ~Planner() = default;
31 
34 
37 
39  virtual bool canSolve(const Problem& problem) const = 0;
40 
46  const Problem& problem, Result* result = nullptr)
47  = 0;
48 
49 protected:
52 
54  std::unique_ptr<common::RNG> mRng;
55 };
56 
59 {
60 public:
64  explicit Result(const std::string& message = "");
65 
67  virtual ~Result() = default;
68 
70  void setMessage(const std::string& message);
71 
73  const std::string& getMessage() const;
74 
75 protected:
77  std::string mMessage;
78 };
79 
80 } // namespace planner
81 } // namespace aikido
82 
83 #endif // AIKIDO_PLANNER_PLANNER_HPP_
aikido::planner::Planner::plan
virtual trajectory::TrajectoryPtr plan(const Problem &problem, Result *result=nullptr)=0
Solves problem returning the result to result.
aikido::planner::Planner::getStateSpace
statespace::ConstStateSpacePtr getStateSpace() const
Returns const state space.
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::planner::Planner::getRng
common::RNG * getRng()
Returns RNG.
StateSpace.hpp
aikido::planner::Planner::Result::getMessage
const std::string & getMessage() const
Returns message.
aikido::planner::Planner::Result::setMessage
void setMessage(const std::string &message)
Sets message.
aikido::statespace::ConstStateSpacePtr
std::shared_ptr< const StateSpace > ConstStateSpacePtr
Definition: StateSpace.hpp:15
aikido::planner::Planner::canSolve
virtual bool canSolve(const Problem &problem) const =0
Returns true if this planner can solve problem.
aikido::planner::Planner::~Planner
virtual ~Planner()=default
Default destructor.
aikido::trajectory::TrajectoryPtr
std::shared_ptr< Trajectory > TrajectoryPtr
Definition: Trajectory.hpp:13
Problem.hpp
aikido::planner::Planner::mRng
std::unique_ptr< common::RNG > mRng
RNG the planner uses.
Definition: Planner.hpp:54
aikido::common::RNG
Implementation of the C++11 "random engine" concept that uses virtual function calls to erase the typ...
Definition: RNG.hpp:24
pointers.hpp
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
Trajectory.hpp
aikido::planner::Planner::Result::~Result
virtual ~Result()=default
Destructor.
aikido::planner::Planner::Result::mMessage
std::string mMessage
Message.
Definition: Planner.hpp:77
aikido::planner::Planner::Planner
Planner(statespace::ConstStateSpacePtr stateSpace, common::RNG *rng=nullptr)
Constructs from a state space.
AIKIDO_DECLARE_POINTERS
#define AIKIDO_DECLARE_POINTERS(X)
Definition: pointers.hpp:21
aikido::planner::Planner::mStateSpace
statespace::ConstStateSpacePtr mStateSpace
State space associated with this planner.
Definition: Planner.hpp:51
aikido::planner::Planner::Result
Base class for planning result of various planning problems.
Definition: Planner.hpp:58
aikido::planner::Planner::Result::Result
Result(const std::string &message="")
Constructor.