Space information containing necessary information for planning with controls. setup() needs to be called before use. More...
#include <SpaceInformation.h>
Public Member Functions | |
const ControlSpacePtr & | getControlSpace (void) const |
Get the control space. | |
virtual void | printSettings (std::ostream &out=std::cout) const |
Print information about the current instance of the state space. | |
virtual void | setup (void) |
Perform additional setup tasks (run once, before use). | |
SpaceInformation (const base::StateSpacePtr &stateSpace, const ControlSpacePtr &controlSpace) | |
Constructor. Sets the instance of the state and control spaces to plan with. | |
virtual | ~SpaceInformation (void) |
Control memory management | |
Control * | allocControl (void) const |
Allocate memory for a control. | |
Control * | cloneControl (const Control *source) const |
Clone a control. | |
void | copyControl (Control *destination, const Control *source) const |
Copy a control to another. | |
void | freeControl (Control *control) const |
Free the memory of a control. | |
Sampling of controls | |
ControlSamplerPtr | allocControlSampler (void) const |
Allocate a control sampler. | |
unsigned int | getMaxControlDuration (void) const |
Get the maximum number of steps a control is propagated for. | |
unsigned int | getMinControlDuration (void) const |
Get the minimum number of steps a control is propagated for. | |
void | setMinMaxControlDuration (unsigned int minSteps, unsigned int maxSteps) |
Set the minimum and maximum number of steps a control is propagated for. | |
Primitives for propagating the model of the system | |
bool | canPropagateBackward (void) const |
Some systems can only propagate forward in time (i.e., the steps argument for the propagate() function is always positive). If this is the case, this function will return false. Planners that need backward propagation (negative steps) will call this function to check. If backward propagation is possible, this function will return true (this is the default). | |
void | propagate (const base::State *state, const Control *control, int steps, std::vector< base::State * > &result, bool alloc) const |
Propagate the model of the system forward, starting a a given state, with a given control, for a given number of steps. | |
void | propagate (const base::State *state, const Control *control, int steps, base::State *result) const |
Propagate the model of the system forward, starting a a given state, with a given control, for a given number of steps. | |
unsigned int | propagateWhileValid (const base::State *state, const Control *control, int steps, std::vector< base::State * > &result, bool alloc) const |
Propagate the model of the system forward, starting at a given state, with a given control, for a given number of steps. Stop if a collision is found and return the number of steps actually performed without collision. If no collision is found, the returned value is equal to the steps argument. If a collision is found after the first step, the return value is 0 and no states are added to result. If alloc is false and result cannot store all the generated states, propagation is stopped prematurely (when result is full). The starting state (state) is not included in result. The return value of the function indicates how many states have been written to result. | |
unsigned int | propagateWhileValid (const base::State *state, const Control *control, int steps, base::State *result) const |
Propagate the model of the system forward, starting at a given state, with a given control, for a given number of steps. Stop if a collision is found and return the number of steps actually performed without collision. If no collision is found, the returned value is equal to the steps argument. If a collision is found after the first step, the return value is 0 and result = state. | |
Topology-specific control operations (as in the control space) | |
bool | equalControls (const Control *control1, const Control *control2) const |
Check if two controls are the same. | |
void | nullControl (Control *control) const |
Make the control have no effect if it were to be applied to a state for any amount of time. | |
void | printControl (const Control *control, std::ostream &out=std::cout) const |
Print a control to a stream. | |
Configuration of the state propagator | |
double | getPropagationStepSize (void) const |
Propagation is performed at integer multiples of a specified step size. This function returns the value of this step size. | |
const StatePropagatorPtr & | getStatePropagator (void) const |
Get the instance of StatePropagator that performs state propagation. | |
void | setPropagationStepSize (double stepSize) |
When controls are applied to states, they are applied for a time duration that is an integer multiple of the stepSize, within the bounds specified by setMinMaxControlDuration(). | |
void | setStatePropagator (const StatePropagatorPtr &sp) |
Set the instance of StatePropagator to perform state propagation. | |
void | setStatePropagator (const StatePropagatorFn &fn) |
Set the function that performs state propagation. | |
Protected Attributes | |
ControlSpacePtr | controlSpace_ |
The control space describing the space of controls applicable to states in the state space. | |
unsigned int | maxSteps_ |
The maximum number of steps to apply a control for. | |
unsigned int | minSteps_ |
The minimum number of steps to apply a control for. | |
StatePropagatorPtr | statePropagator_ |
The state propagator used to model the motion of the system being planned for. | |
double | stepSize_ |
The actual duration of each step. |
Space information containing necessary information for planning with controls. setup() needs to be called before use.
Definition at line 66 of file control/SpaceInformation.h.
ompl::control::SpaceInformation::SpaceInformation | ( | const base::StateSpacePtr & | stateSpace, | |
const ControlSpacePtr & | controlSpace | |||
) | [inline] |
Constructor. Sets the instance of the state and control spaces to plan with.
Definition at line 71 of file control/SpaceInformation.h.
virtual ompl::control::SpaceInformation::~SpaceInformation | ( | void | ) | [inline, virtual] |
Reimplemented from ompl::base::SpaceInformation.
Definition at line 77 of file control/SpaceInformation.h.
Control* ompl::control::SpaceInformation::allocControl | ( | void | ) | const [inline] |
Allocate memory for a control.
Definition at line 91 of file control/SpaceInformation.h.
ControlSamplerPtr ompl::control::SpaceInformation::allocControlSampler | ( | void | ) | const [inline] |
Allocate a control sampler.
Definition at line 145 of file control/SpaceInformation.h.
bool ompl::control::SpaceInformation::canPropagateBackward | ( | void | ) | const |
Some systems can only propagate forward in time (i.e., the steps argument for the propagate() function is always positive). If this is the case, this function will return false. Planners that need backward propagation (negative steps) will call this function to check. If backward propagation is possible, this function will return true (this is the default).
Clone a control.
Definition at line 109 of file control/SpaceInformation.h.
void ompl::control::SpaceInformation::copyControl | ( | Control * | destination, | |
const Control * | source | |||
) | const [inline] |
Copy a control to another.
Definition at line 103 of file control/SpaceInformation.h.
bool ompl::control::SpaceInformation::equalControls | ( | const Control * | control1, | |
const Control * | control2 | |||
) | const [inline] |
Check if two controls are the same.
Definition at line 128 of file control/SpaceInformation.h.
void ompl::control::SpaceInformation::freeControl | ( | Control * | control | ) | const [inline] |
Free the memory of a control.
Definition at line 97 of file control/SpaceInformation.h.
const ControlSpacePtr& ompl::control::SpaceInformation::getControlSpace | ( | void | ) | const [inline] |
Get the control space.
Definition at line 82 of file control/SpaceInformation.h.
unsigned int ompl::control::SpaceInformation::getMaxControlDuration | ( | void | ) | const [inline] |
Get the maximum number of steps a control is propagated for.
Definition at line 164 of file control/SpaceInformation.h.
unsigned int ompl::control::SpaceInformation::getMinControlDuration | ( | void | ) | const [inline] |
Get the minimum number of steps a control is propagated for.
Definition at line 158 of file control/SpaceInformation.h.
double ompl::control::SpaceInformation::getPropagationStepSize | ( | void | ) | const [inline] |
Propagation is performed at integer multiples of a specified step size. This function returns the value of this step size.
Definition at line 193 of file control/SpaceInformation.h.
const StatePropagatorPtr& ompl::control::SpaceInformation::getStatePropagator | ( | void | ) | const [inline] |
Get the instance of StatePropagator that performs state propagation.
Definition at line 174 of file control/SpaceInformation.h.
void ompl::control::SpaceInformation::nullControl | ( | Control * | control | ) | const [inline] |
Make the control have no effect if it were to be applied to a state for any amount of time.
Definition at line 134 of file control/SpaceInformation.h.
void ompl::control::SpaceInformation::printControl | ( | const Control * | control, | |
std::ostream & | out = std::cout | |||
) | const [inline] |
Print a control to a stream.
Definition at line 122 of file control/SpaceInformation.h.
virtual void ompl::control::SpaceInformation::printSettings | ( | std::ostream & | out = std::cout |
) | const [virtual] |
Print information about the current instance of the state space.
Reimplemented from ompl::base::SpaceInformation.
void ompl::control::SpaceInformation::propagate | ( | const base::State * | state, | |
const Control * | control, | |||
int | steps, | |||
std::vector< base::State * > & | result, | |||
bool | alloc | |||
) | const |
Propagate the model of the system forward, starting a a given state, with a given control, for a given number of steps.
state | the state to start at | |
control | the control to apply | |
steps | the number of time steps to apply the control for. Each time step is of length getPropagationStepSize(). If steps is negative, backward propagation will be performed. | |
result | the set of states along the propagated motion | |
alloc | flag indicating whether memory for the states in result should be allocated |
void ompl::control::SpaceInformation::propagate | ( | const base::State * | state, | |
const Control * | control, | |||
int | steps, | |||
base::State * | result | |||
) | const |
Propagate the model of the system forward, starting a a given state, with a given control, for a given number of steps.
state | the state to start at | |
control | the control to apply | |
steps | the number of time steps to apply the control for. Each time step is of length getPropagationStepSize() | |
result | the state at the end of the propagation |
unsigned int ompl::control::SpaceInformation::propagateWhileValid | ( | const base::State * | state, | |
const Control * | control, | |||
int | steps, | |||
std::vector< base::State * > & | result, | |||
bool | alloc | |||
) | const |
Propagate the model of the system forward, starting at a given state, with a given control, for a given number of steps. Stop if a collision is found and return the number of steps actually performed without collision. If no collision is found, the returned value is equal to the steps argument. If a collision is found after the first step, the return value is 0 and no states are added to result. If alloc is false and result cannot store all the generated states, propagation is stopped prematurely (when result is full). The starting state (state) is not included in result. The return value of the function indicates how many states have been written to result.
state | the state to start at | |
control | the control to apply | |
steps | the maximum number of time steps to apply the control for. Each time step is of length getPropagationStepSize(). If steps is negative, backward propagation will be performed. | |
result | the set of states along the propagated motion (only valid states included) | |
alloc | flag indicating whether memory for the states in result should be allocated |
unsigned int ompl::control::SpaceInformation::propagateWhileValid | ( | const base::State * | state, | |
const Control * | control, | |||
int | steps, | |||
base::State * | result | |||
) | const |
Propagate the model of the system forward, starting at a given state, with a given control, for a given number of steps. Stop if a collision is found and return the number of steps actually performed without collision. If no collision is found, the returned value is equal to the steps argument. If a collision is found after the first step, the return value is 0 and result = state.
state | the state to start at | |
control | the control to apply | |
steps | the maximum number of time steps to apply the control for. Each time step is of length getPropagationStepSize(). If steps is negative, backward propagation will be performed. | |
result | the state at the end of the propagation or the last valid state if a collision is found |
void ompl::control::SpaceInformation::setMinMaxControlDuration | ( | unsigned int | minSteps, | |
unsigned int | maxSteps | |||
) | [inline] |
Set the minimum and maximum number of steps a control is propagated for.
Definition at line 151 of file control/SpaceInformation.h.
void ompl::control::SpaceInformation::setPropagationStepSize | ( | double | stepSize | ) | [inline] |
When controls are applied to states, they are applied for a time duration that is an integer multiple of the stepSize, within the bounds specified by setMinMaxControlDuration().
Definition at line 187 of file control/SpaceInformation.h.
void ompl::control::SpaceInformation::setStatePropagator | ( | const StatePropagatorPtr & | sp | ) |
Set the instance of StatePropagator to perform state propagation.
void ompl::control::SpaceInformation::setStatePropagator | ( | const StatePropagatorFn & | fn | ) |
Set the function that performs state propagation.
virtual void ompl::control::SpaceInformation::setup | ( | void | ) | [virtual] |
Perform additional setup tasks (run once, before use).
Reimplemented from ompl::base::SpaceInformation.
The control space describing the space of controls applicable to states in the state space.
Definition at line 259 of file control/SpaceInformation.h.
unsigned int ompl::control::SpaceInformation::maxSteps_ [protected] |
The maximum number of steps to apply a control for.
Definition at line 268 of file control/SpaceInformation.h.
unsigned int ompl::control::SpaceInformation::minSteps_ [protected] |
The minimum number of steps to apply a control for.
Definition at line 265 of file control/SpaceInformation.h.
StatePropagatorPtr ompl::control::SpaceInformation::statePropagator_ [protected] |
The state propagator used to model the motion of the system being planned for.
Definition at line 262 of file control/SpaceInformation.h.
double ompl::control::SpaceInformation::stepSize_ [protected] |
The actual duration of each step.
Definition at line 271 of file control/SpaceInformation.h.