Go to the documentation of this file.
30 #ifndef EXOTICA_OMPL_CONTROL_SOLVER_OMPL_CONTROL_SOLVER_H_
31 #define EXOTICA_OMPL_CONTROL_SOLVER_OMPL_CONTROL_SOLVER_H_
37 #include <exotica_ompl_control_solver/ompl_control_solver_initializer.h>
40 #include <ompl/base/goals/GoalState.h>
41 #include <ompl/base/spaces/SE2StateSpace.h>
42 #include <ompl/control/SimpleSetup.h>
43 #include <ompl/control/SpaceInformation.h>
44 #include <ompl/control/spaces/RealVectorControlSpace.h>
46 namespace ob = ompl::base;
47 namespace oc = ompl::control;
57 oc::SpaceInformationPtr si,
60 const ob::State *state,
61 const oc::Control *control,
62 const double duration,
63 ob::State *result)
const override
66 space_->copyState(result, state);
90 void Integrate(ob::State *ob_x,
const oc::Control *oc_u,
double dt)
const
95 double *x = ob_x->as<ob::RealVectorStateSpace::StateType>()->values;
96 double *u = oc_u->as<oc::RealVectorControlSpace::ControlType>()->values;
98 Eigen::VectorXd eig_x = Eigen::Map<Eigen::VectorXd>(x, NX);
99 Eigen::VectorXd eig_u = Eigen::Map<Eigen::VectorXd>(u, NU);
102 std::memcpy(x, x_new.data(), NX *
sizeof(
double));
111 void Solve(Eigen::MatrixXd &solution)
override;
119 template <
typename PlannerType>
122 ob::PlannerPtr planner(
new PlannerType(si));
137 bool isStateValid(
const oc::SpaceInformationPtr si,
const ob::State *state)
145 #endif // EXOTICA_OMPL_CONTROL_SOLVER_OMPL_CONTROL_SOLVER_H_
bool isStateValid(const oc::SpaceInformationPtr si, const ob::State *state)
Definition: ompl_control_solver.h:137
void propagate(const ob::State *state, const oc::Control *control, const double duration, ob::State *result) const override
Definition: ompl_control_solver.h:59
void Integrate(ob::State *ob_x, const oc::Control *oc_u, double dt) const
Definition: ompl_control_solver.h:90
DynamicsSolverPtr dynamics_solver_
!< Shared pointer to the planning problem.
Definition: ompl_control_solver.h:127
OMPLStatePropagator(oc::SpaceInformationPtr si, DynamicsSolverPtr dynamics_solver_)
Definition: ompl_control_solver.h:56
double timeStep_
Definition: ompl_control_solver.h:86
ConfiguredPlannerAllocator planner_allocator_
Definition: ompl_control_solver.h:133
void setIntegrationTimeStep(double timeStep)
Definition: ompl_control_solver.h:75
oc::SpaceInformationPtr space_
Definition: ompl_control_solver.h:87
Definition: ompl_control_solver.h:106
std::shared_ptr< exotica::DynamicsSolver > DynamicsSolverPtr
Definition: dynamics_solver.h:269
Definition: cartpole_dynamics_solver.h:38
std::string algorithm_
Definition: ompl_control_solver.h:132
void Solve(Eigen::MatrixXd &solution) override
Solves the problem.
boost::function< ompl::base::PlannerPtr(const ompl::base::SpaceInformationPtr &si, const std::string &name)> ConfiguredPlannerAllocator
Definition: time_indexed_rrt_connect.h:104
void SpecifyProblem(PlanningProblemPtr pointer) override
Binds the solver to a specific problem which must be pre-initalised.
std::shared_ptr< exotica::DynamicTimeIndexedShootingProblem > DynamicTimeIndexedShootingProblemPtr
Definition: dynamic_time_indexed_shooting_problem.h:231
DynamicsSolverPtr dynamics_solver_
Definition: ompl_control_solver.h:88
double getIntegrationTimeStep() const
Definition: ompl_control_solver.h:80
Definition: motion_solver.h:42
std::shared_ptr< PlanningProblem > PlanningProblemPtr
Definition: planning_problem.h:116
std::unique_ptr< oc::SimpleSetup > setup_
Definition: ompl_control_solver.h:131
static ob::PlannerPtr AllocatePlanner(const oc::SpaceInformationPtr &si)
Definition: ompl_control_solver.h:120
DynamicTimeIndexedShootingProblemPtr prob_
Definition: ompl_control_solver.h:126
std::function< ob::PlannerPtr(const oc::SpaceInformationPtr &si)> ConfiguredPlannerAllocator
Definition: ompl_control_solver.h:49
Definition: ompl_control_solver.h:53
OMPLControlSolverInitializer init_
!< Shared pointer to the dynamics solver.
Definition: ompl_control_solver.h:129