Space information containing necessary information for planning with controls. setup() needs to be called before use. More...
#include <SpaceInformation.h>
Public Member Functions | |
SpaceInformation (const base::StateSpacePtr &stateSpace, const ControlSpacePtr &controlSpace) | |
Constructor. Sets the instance of the state and control spaces to plan with. | |
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) | |
Control memory management | |
Control * | allocControl (void) const |
Allocate memory for a control. | |
void | freeControl (Control *control) const |
Free the memory of a control. | |
void | copyControl (Control *destination, const Control *source) const |
Copy a control to another. | |
Control * | cloneControl (const Control *source) const |
Clone a control. | |
Topology-specific control operations (as in the control space) | |
void | printControl (const Control *control, std::ostream &out=std::cout) const |
Print a control to a stream. | |
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. | |
Sampling of controls | |
ControlSamplerPtr | allocControlSampler (void) const |
Allocate a control sampler. | |
void | setMinMaxControlDuration (unsigned int minSteps, unsigned int maxSteps) |
Set the minimum and 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. | |
unsigned int | getMaxControlDuration (void) const |
Get the maximum number of steps a control is propagated for. | |
Configuration of the state propagator | |
const StatePropagatorPtr & | getStatePropagator (void) const |
Get the instance of StatePropagator that performs state propagation. | |
void | setStatePropagator (const StatePropagatorFn &fn) |
Set the function that performs state propagation. | |
void | setStatePropagator (const StatePropagatorPtr &sp) |
Set the instance of StatePropagator to perform 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() | |
double | getPropagationStepSize (void) const |
Propagation is performed at integer multiples of a specified step size. This function returns the value of this step size. | |
Primitives for propagating the model of the system | |
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. | |
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). | |
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. | |
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. | |
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. | |
Protected Attributes | |
ControlSpacePtr | controlSpace_ |
The control space describing the space of controls applicable to states in the state space. | |
StatePropagatorPtr | statePropagator_ |
The state propagator used to model the motion of the system being planned for. | |
unsigned int | minSteps_ |
The minimum number of steps to apply a control for. | |
unsigned int | maxSteps_ |
The maximum number of steps to apply a control 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 SpaceInformation.h.
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 |
Definition at line 106 of file SpaceInformation.cpp.
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 |
Definition at line 181 of file SpaceInformation.cpp.
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 |
Definition at line 124 of file SpaceInformation.cpp.
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 |
Definition at line 214 of file SpaceInformation.cpp.