37 #ifndef OMPL_CONTROL_SPACES_DISCRETE_CONTROL_SPACE_
38 #define OMPL_CONTROL_SPACES_DISCRETE_CONTROL_SPACE_
40 #include "ompl/control/ControlSpace.h"
91 virtual void copyControl(Control *destination,
const Control *source)
const;
93 virtual bool equalControls(
const Control *control1,
const Control *control2)
const;
104 virtual void printControl(
const Control *control, std::ostream &out)
const;
133 virtual void setup(
void);
Abstract definition of a control sampler. Motion planners that need to sample controls will call func...
virtual ControlSamplerPtr allocDefaultControlSampler(void) const
Allocate the default control sampler.
virtual void printControl(const Control *control, std::ostream &out) const
Print a control to a stream.
Definition of an abstract control.
A boost shared pointer wrapper for ompl::base::StateSpace.
virtual bool equalControls(const Control *control1, const Control *control2) const
Check if two controls are the same.
virtual Control * allocControl(void) const
Allocate memory for a control.
A space representing discrete controls; i.e. there are a small number of discrete controls the system...
virtual void deserialize(Control *ctrl, const void *serialization) const
Deserializes a control from the serialization buffer.
virtual void sample(Control *control)
Sample a control. All other control sampling functions default to this one, unless a user-specified i...
void setName(const std::string &name)
Set the name of the control space.
DiscreteControlSpace(const base::StateSpacePtr &stateSpace, int lowerBound, int upperBound)
Construct a discrete space in wich controls can take values in the set [lowerBound, upperBound].
The definition of a discrete control.
int upperBound_
The highest integer state.
virtual void printSettings(std::ostream &out) const
Print the settings for this control space to a stream.
int value
The current control - an int in range [lowerBound, upperBound].
ompl::control::DiscreteControlSpace
Control space sampler for discrete controls.
virtual void serialize(void *serialization, const Control *ctrl) const
Serializes the given control into the serialization buffer.
const std::string & getName(void) const
Get the name of the control space.
virtual void nullControl(Control *control) const
This sets the control value to lowerBound_.
int type_
A type assigned for this control space.
int getLowerBound(void) const
Returns the lowest possible control value.
A control space representing the space of applicable controls.
virtual void setup(void)
Perform final setup steps. This function is automatically called by the SpaceInformation.
int lowerBound_
The lowest integer state.
virtual void copyControl(Control *destination, const Control *source) const
Copy a control to another.
DiscreteControlSampler(const ControlSpace *space)
Constructor.
virtual void freeControl(Control *control) const
Free the memory of a control.
int getUpperBound(void) const
Returns the highest possible control value.
void setBounds(int lowerBound, int upperBound)
Set the bounds for the states in this space (the states will be in the set [lowerBound, upperBound].
unsigned int getControlCount(void) const
Returns the number of controls possible.
virtual unsigned int getDimension(void) const
Get the dimension of this control space.
virtual unsigned int getSerializationLength(void) const
Returns the serialization size for a single control in this space.