37 #ifndef OMPL_EXTENSION_OPENDE_ENVIRONMENT_
38 #define OMPL_EXTENSION_OPENDE_ENVIRONMENT_
40 #include "ompl/config.h"
41 #if OMPL_EXTENSION_OPENDE == 0
42 # error OpenDE extension not built
45 #include "ompl/util/ClassForward.h"
51 #include <boost/thread/mutex.hpp>
60 OMPL_CLASS_FORWARD(OpenDEEnvironment);
83 std::map<dGeomID, std::string>
122 virtual void getControlBounds(std::vector<double> &lower, std::vector<double> &upper)
const = 0;
127 virtual void applyControl(
const double *control)
const = 0;
133 virtual bool isValidCollision(dGeomID geom1, dGeomID geom2,
const dContact& contact)
const;
138 virtual unsigned int getMaxContacts(dGeomID geom1, dGeomID geom2)
const;
141 virtual void setupContact(dGeomID geom1, dGeomID geom2, dContact &contact)
const;
147 void setGeomName(dGeomID geom,
const std::string &name);
virtual void applyControl(const double *control) const =0
Application of a control. This function sets the forces/torques/velocities for bodies in the simulati...
double stepSize_
The simulation step size.
unsigned int minControlSteps_
The minimum number of times a control is applies in sequence.
unsigned int maxControlSteps_
The maximum number of times a control is applies in sequence.
std::vector< dSpaceID > collisionSpaces_
The set of spaces where contacts need to be evaluated before simulation takes place.
unsigned int maxContacts_
The maximum number of contacts to create between two bodies when a collision occurs.
dWorldID world_
The OpenDE world where the simulation is performed.
std::string getGeomName(dGeomID geom) const
Get the name of a body.
virtual void getControlBounds(std::vector< double > &lower, std::vector< double > &upper) const =0
Get the control bounds – the bounding box in which to sample controls.
virtual void setupContact(dGeomID geom1, dGeomID geom2, dContact &contact) const
Parameters to set when contacts are created between geom1 and geom2.
This class contains the OpenDE constructs OMPL needs to know about when planning. ...
std::map< dGeomID, std::string > geomNames_
Optional map of names given to geoms. This is useful when collision checking is verbose.
virtual unsigned int getMaxContacts(dGeomID geom1, dGeomID geom2) const
Get the maximum number of contacts to set up between two colliding geoms. By default, this just returns the member variable maxContacts.
boost::mutex mutex_
Lock to use when performing simulations in the world. (OpenDE simulations are NOT thread safe) ...
std::vector< dBodyID > stateBodies_
The set of bodies that need to be considered part of the state when planning. This is not necessarily...
virtual bool isValidCollision(dGeomID geom1, dGeomID geom2, const dContact &contact) const
Decide whether a collision is a valid one or not. In some cases, collisions between some bodies can b...
void setGeomName(dGeomID geom, const std::string &name)
Set the name of a body.
dJointGroupID contactGroup_
The group of joints where contacts are created.
virtual unsigned int getControlDimension(void) const =0
Number of parameters (double values) needed to specify a control input.
bool verboseContacts_
Issue debug messages when contacts are found. Default is false. This should only be used for debuggin...