37 #ifndef OMPL_EXTENSION_MORSE_ENVIRONMENT_
38 #define OMPL_EXTENSION_MORSE_ENVIRONMENT_
40 #include "ompl/config.h"
41 #if OMPL_EXTENSION_MORSE == 0
42 # error MORSE extension not built
45 #include "ompl/base/State.h"
46 #include "ompl/util/ClassForward.h"
48 #include "boost/thread/mutex.hpp"
60 OMPL_CLASS_FORWARD(MorseEnvironment);
104 MorseEnvironment(
const unsigned int controlDim,
const std::vector<double> &controlBounds,
105 const unsigned int rigidBodies,
const std::vector<double> &positionBounds,
106 const std::vector<double> &linvelBounds,
const std::vector<double> &angvelBounds,
107 const double stepSize,
const unsigned int minControlSteps,
const unsigned int maxControlSteps)
123 if (
linvelBounds_[i]==std::numeric_limits<double>::infinity())
125 else if (
linvelBounds_[i]==-std::numeric_limits<double>::infinity())
130 if (
angvelBounds_[i]==std::numeric_limits<double>::infinity())
132 else if (
angvelBounds_[i]==-std::numeric_limits<double>::infinity())
142 void getControlBounds(std::vector<double> &lower, std::vector<double> &upper)
const;
148 virtual void readState(State *state) = 0;
151 virtual void writeState(
const State *state) = 0;
154 virtual void applyControl(
const std::vector<double> &control) = 0;
157 virtual void worldStep(
const double dur) = 0;
bool simRunning_
Indicates whether the simulation has been shut down externally.
This class contains the MORSE constructs OMPL needs to know about when planning.
virtual void worldStep(const double dur)=0
Proceed with the simulation for the given number of seconds.
std::vector< double > linvelBounds_
Upper and lower bounds on linear velocity in each spatial dimension.
virtual void applyControl(const std::vector< double > &control)=0
Configure simulation to proceed under a new control.
const unsigned int controlDim_
The dimension of the control space for this simulation.
boost::mutex mutex_
Lock to use when performing simulations in the world.
const std::vector< double > controlBounds_
Upper and lower bounds for each control dimension.
void getControlBounds(std::vector< double > &lower, std::vector< double > &upper) const
Get the control bounds – the bounding box in which to sample controls.
virtual void readState(State *state)=0
Query the internal state of the simulation.
unsigned int minControlSteps_
The minimum number of times a control is applied in sequence.
unsigned int maxControlSteps_
The maximum number of times a control is applied in sequence.
double stepSize_
The simulation step size.
std::vector< double > positionBounds_
Upper and lower bounds on position in each spatial dimension.
const unsigned int rigidBodies_
The number of rigid bodies in the simulation.
virtual void writeState(const State *state)=0
Overwrite the internal state of the simulation.
std::vector< double > angvelBounds_
Upper and lower bounds on angular velocity in each spatial dimension.