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::StateManifoldPtr &stateManifold, const ControlManifoldPtr &controlManifold) | |
Constructor. Sets the instance of the manifold to plan on. | |
const ControlManifoldPtr & | getControlManifold (void) const |
Get the control manifold. | |
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 manifold) | |
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 | 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. | |
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. | |
Primitives for propagating the model of the system | |
void | propagate (const base::State *state, const Control *control, unsigned 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, unsigned 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, unsigned 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, unsigned 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 | |
ControlManifoldPtr | controlManifold_ |
The manifold describing the space of controls applicable to states in the state manifold. | |
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 61 of file SpaceInformation.h.
void ompl::control::SpaceInformation::propagate | ( | const base::State * | state, |
const Control * | control, | ||
unsigned 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() |
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 139 of file SpaceInformation.cpp.
void ompl::control::SpaceInformation::propagate | ( | const base::State * | state, |
const Control * | control, | ||
unsigned 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 70 of file SpaceInformation.cpp.
unsigned int ompl::control::SpaceInformation::propagateWhileValid | ( | const base::State * | state, |
const Control * | control, | ||
unsigned 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() |
result | the state at the end of the propagation or the last valid state if a collision is found |
Definition at line 85 of file SpaceInformation.cpp.
unsigned int ompl::control::SpaceInformation::propagateWhileValid | ( | const base::State * | state, |
const Control * | control, | ||
unsigned 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() |
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 169 of file SpaceInformation.cpp.