Go to the documentation of this file.
30 #ifndef EXOTICA_OMPL_SOLVER_OMPL_EXO_H_
31 #define EXOTICA_OMPL_SOLVER_OMPL_EXO_H_
35 #include <ompl/base/SpaceInformation.h>
36 #include <ompl/base/StateSpace.h>
37 #include <ompl/base/StateValidityChecker.h>
38 #include <ompl/base/spaces/DubinsStateSpace.h>
39 #include <ompl/base/spaces/RealVectorStateSpace.h>
40 #include <ompl/base/spaces/SE2StateSpace.h>
41 #include <ompl/base/spaces/SE3StateSpace.h>
42 #include <ompl/geometric/SimpleSetup.h>
44 #include <exotica_ompl_solver/ompl_solver_initializer.h>
46 #if OMPL_VERSION_VALUE >= 1004000 // Version greater than 1.4.0
48 #else // All other versions
62 virtual void ExoticaToOMPLState(
const Eigen::VectorXd &q, ompl::base::State *state)
const = 0;
63 virtual void OMPLToExoticaState(
const ompl::base::State *state, Eigen::VectorXd &q)
const = 0;
66 virtual void StateDebug(
const Eigen::VectorXd &q)
const = 0;
77 bool isValid(
const ompl::base::State *state)
const override;
79 bool isValid(
const ompl::base::State *state,
double &dist)
const override;
88 class StateType :
public ompl::base::CompoundStateSpace::StateType
95 const ompl::base::RealVectorStateSpace::StateType &
getRNSpace()
const
97 return *as<ompl::base::RealVectorStateSpace::StateType>(0);
102 return *as<ompl::base::RealVectorStateSpace::StateType>(0);
109 void ExoticaToOMPLState(
const Eigen::VectorXd &q, ompl::base::State *state)
const override;
110 void OMPLToExoticaState(
const ompl::base::State *state, Eigen::VectorXd &q)
const override;
111 void StateDebug(
const Eigen::VectorXd &q)
const override;
117 class StateType :
public ompl::base::CompoundStateSpace::StateType
126 return *as<ompl::base::RealVectorStateSpace::StateType>(1);
131 return *as<ompl::base::RealVectorStateSpace::StateType>(1);
136 return *as<ompl::base::SE3StateSpace::StateType>(0);
140 return *as<ompl::base::SE3StateSpace::StateType>(0);
147 void ExoticaToOMPLState(
const Eigen::VectorXd &q, ompl::base::State *state)
const override;
148 void OMPLToExoticaState(
const ompl::base::State *state, Eigen::VectorXd &q)
const override;
149 void StateDebug(
const Eigen::VectorXd &q)
const override;
158 class StateType :
public ompl::base::CompoundStateSpace::StateType
167 return *as<ompl::base::RealVectorStateSpace::StateType>(1);
172 return *as<ompl::base::RealVectorStateSpace::StateType>(1);
177 return *as<ompl::base::SE2StateSpace::StateType>(0);
181 return *as<ompl::base::SE2StateSpace::StateType>(0);
188 void ExoticaToOMPLState(
const Eigen::VectorXd &q, ompl::base::State *state)
const override;
189 void OMPLToExoticaState(
const ompl::base::State *state, Eigen::VectorXd &q)
const override;
190 void StateDebug(
const Eigen::VectorXd &q)
const override;
199 class StateType :
public ompl::base::CompoundStateSpace::StateType
208 return *as<ompl::base::RealVectorStateSpace::StateType>(1);
213 return *as<ompl::base::RealVectorStateSpace::StateType>(1);
218 return *as<ompl::base::DubinsStateSpace::StateType>(0);
222 return *as<ompl::base::DubinsStateSpace::StateType>(0);
229 void ExoticaToOMPLState(
const Eigen::VectorXd &q, ompl::base::State *state)
const override;
230 void OMPLToExoticaState(
const ompl::base::State *state, Eigen::VectorXd &q)
const override;
231 void StateDebug(
const Eigen::VectorXd &q)
const override;
241 const std::vector<int> &vars)
242 : ompl::base::ProjectionEvaluator(space),
variables_(vars)
264 for (std::size_t i = 0; i <
variables_.size(); ++i)
277 const std::vector<int> &vars)
278 : ompl::base::ProjectionEvaluator(space),
variables_(vars)
300 for (std::size_t i = 0; i <
variables_.size(); ++i)
313 const std::vector<int> &vars)
314 : ompl::base::ProjectionEvaluator(space),
variables_(vars)
336 for (std::size_t i = 0; i <
variables_.size(); ++i)
346 #endif // EXOTICA_OMPL_SOLVER_OMPL_EXO_H_
ompl::base::StateSamplerPtr allocDefaultStateSampler() const override
StateType()
Definition: ompl_exo.h:91
void SetBounds(SamplingProblemPtr &prob) override
Definition: ompl_exo.h:309
ompl::base::RealVectorStateSpace::StateType & RealVectorStateSpace()
Definition: ompl_exo.h:129
void ExoticaToOMPLState(const Eigen::VectorXd &q, ompl::base::State *state) const override
void OMPLToExoticaState(const ompl::base::State *state, Eigen::VectorXd &q) const override
Definition: ompl_exo.h:155
StateType()
Definition: ompl_exo.h:120
const ompl::base::RealVectorStateSpace::StateType & getRNSpace() const
Definition: ompl_exo.h:95
Definition: ompl_exo.h:196
void ExoticaToOMPLState(const Eigen::VectorXd &q, ompl::base::State *state) const override
Definition: ompl_exo.h:54
unsigned int dim_
Definition: ompl_exo.h:234
bool isValid(const ompl::base::State *state) const override
ompl::base::StateSamplerPtr allocDefaultStateSampler() const override
ompl::base::StateSamplerPtr allocDefaultStateSampler() const override
std::vector< int > variables_
Definition: ompl_exo.h:342
OMPLStateSpace(OMPLSolverInitializer init)
Definition: ompl_exo.h:57
const ompl::base::RealVectorStateSpace::StateType & RealVectorStateSpace() const
Definition: ompl_exo.h:165
OMPLRNStateSpace(OMPLSolverInitializer init)
void OMPLToExoticaState(const ompl::base::State *state, Eigen::VectorXd &q) const override
void ExoticaToOMPLState(const Eigen::VectorXd &q, ompl::base::State *state) const override
unsigned int dim_
Definition: ompl_exo.h:152
Definition: ompl_exo.h:114
unsigned int getDimension(void) const override
Definition: ompl_exo.h:286
void SetBounds(SamplingProblemPtr &prob) override
Definition: cartpole_dynamics_solver.h:38
void project(const ompl::base::State *state, OMPLProjection projection) const override
Definition: ompl_exo.h:333
Definition: ompl_exo.h:199
Definition: ompl_exo.h:85
std::vector< int > variables_
Definition: ompl_exo.h:306
~OMPLRNProjection()
Definition: ompl_exo.h:246
OMPLSE2RNStateSpace(OMPLSolverInitializer init)
virtual ompl::base::StateSamplerPtr allocDefaultStateSampler() const =0
void SetBounds(SamplingProblemPtr &prob) override
SamplingProblemPtr prob_
Definition: ompl_exo.h:82
virtual void ExoticaToOMPLState(const Eigen::VectorXd &q, ompl::base::State *state) const =0
void StateDebug(const Eigen::VectorXd &q) const override
virtual void OMPLToExoticaState(const ompl::base::State *state, Eigen::VectorXd &q) const =0
StateType()
Definition: ompl_exo.h:161
ompl::base::SE2StateSpace::StateType & SE2StateSpace()
Definition: ompl_exo.h:179
OMPLRNProjection(const ompl::base::StateSpacePtr &space, const std::vector< int > &vars)
Definition: ompl_exo.h:240
OMPLSolverInitializer init_
Definition: ompl_exo.h:69
~OMPLSE3RNProjection()
Definition: ompl_exo.h:282
void defaultCellSizes() override
Definition: ompl_exo.h:291
void OMPLToExoticaState(const ompl::base::State *state, Eigen::VectorXd &q) const override
OMPLSE3RNStateSpace(OMPLSolverInitializer init)
const ompl::base::SE2StateSpace::StateType & SE2StateSpace() const
Definition: ompl_exo.h:175
Definition: ompl_exo.h:117
void defaultCellSizes() override
Definition: ompl_exo.h:327
unsigned int getDimension(void) const override
Definition: ompl_exo.h:250
void ExoticaToOMPLState(const Eigen::VectorXd &q, ompl::base::State *state) const override
unsigned int getDimension(void) const override
Definition: ompl_exo.h:322
Definition: ompl_exo.h:158
const ompl::base::SE3StateSpace::StateType & SE3StateSpace() const
Definition: ompl_exo.h:134
ompl::base::StateSamplerPtr allocDefaultStateSampler() const override
Definition: ompl_exo.h:273
OMPLStateValidityChecker(const ompl::base::SpaceInformationPtr &si, const SamplingProblemPtr &prob)
virtual void StateDebug(const Eigen::VectorXd &q) const =0
OMPLDubinsRNStateSpace(OMPLSolverInitializer init)
unsigned int dim_
Definition: ompl_exo.h:193
Definition: ompl_exo.h:88
const ompl::base::RealVectorStateSpace::StateType & RealVectorStateSpace() const
Definition: ompl_exo.h:124
void project(const ompl::base::State *state, OMPLProjection projection) const override
Definition: ompl_exo.h:297
Definition: ompl_exo.h:72
void StateDebug(const Eigen::VectorXd &q) const override
std::vector< int > variables_
Definition: ompl_exo.h:270
std::shared_ptr< exotica::SamplingProblem > SamplingProblemPtr
Definition: sampling_problem.h:83
ompl::base::SE3StateSpace::StateType & SE3StateSpace()
Definition: ompl_exo.h:138
ompl::base::EuclideanProjection & OMPLProjection
Definition: ompl_exo.h:49
Definition: ompl_exo.h:237
void SetBounds(SamplingProblemPtr &prob) override
StateType()
Definition: ompl_exo.h:202
const ompl::base::RealVectorStateSpace::StateType & RealVectorStateSpace() const
Definition: ompl_exo.h:206
void StateDebug(const Eigen::VectorXd &q) const override
OMPLSE2RNProjection(const ompl::base::StateSpacePtr &space, const std::vector< int > &vars)
Definition: ompl_exo.h:312
ompl::base::RealVectorStateSpace::StateType & RealVectorStateSpace()
Definition: ompl_exo.h:211
ompl::base::RealVectorStateSpace::StateType & RealVectorStateSpace()
Definition: ompl_exo.h:170
void defaultCellSizes() override
Definition: ompl_exo.h:255
void StateDebug(const Eigen::VectorXd &q) const override
const ompl::base::DubinsStateSpace::StateType & DubinsStateSpace() const
Definition: ompl_exo.h:216
virtual void SetBounds(SamplingProblemPtr &prob)=0
void project(const ompl::base::State *state, OMPLProjection projection) const override
Definition: ompl_exo.h:261
~OMPLSE2RNProjection()
Definition: ompl_exo.h:318
ompl::base::RealVectorStateSpace::StateType & getRNSpace()
Definition: ompl_exo.h:100
ompl::base::SE2StateSpace::StateType & DubinsStateSpace()
Definition: ompl_exo.h:220
OMPLSE3RNProjection(const ompl::base::StateSpacePtr &space, const std::vector< int > &vars)
Definition: ompl_exo.h:276
void OMPLToExoticaState(const ompl::base::State *state, Eigen::VectorXd &q) const override