PathControl.cpp
86 throw Exception("Cannot create a path with controls from a space that does not support controls");
126 ompl::base::Cost ompl::control::PathControl::cost(const base::OptimizationObjectivePtr &opt) const
169 const ControlSpace *cs = static_cast<const SpaceInformation*>(si_.get())->getControlSpace().get();
194 OMPL_ERROR("Interpolation not performed. Number of states in the path should be strictly greater than the number of controls.");
271 void ompl::control::PathControl::append(const base::State *state, const Control *control, double duration)
295 unsigned int steps = cs->sampleStepCount(si->getMinControlDuration(), si->getMaxControlDuration());
320 unsigned int steps = cs->sampleStepCount(si->getMinControlDuration(), si->getMaxControlDuration());
double distance(const State *state1, const State *state2) const
Compute the distance between two states.
Definition: SpaceInformation.h:125
virtual void printAsMatrix(std::ostream &out) const
Print the path as a real-valued matrix where the i-th row represents the i-th state along the path...
Definition: PathControl.cpp:155
PathControl & operator=(const PathControl &other)
Assignment operator.
Definition: PathControl.cpp:103
unsigned int getSubspaceCount() const
Get the number of control spaces that make up the compound control space.
Definition: ControlSpace.cpp:152
virtual bool sample(State *state)
Sample a state. Return false in case of failure.
Definition: UniformValidStateSampler.cpp:46
unsigned int getMinControlDuration() const
Get the minimum number of steps a control is propagated for.
Definition: SpaceInformation.h:161
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...
Definition: SpaceInformation.cpp:147
void append(const base::State *state)
Append state to the end of the path; it is assumed state is the first state, so no control is applied...
Definition: PathControl.cpp:266
A boost shared pointer wrapper for ompl::base::StateSampler.
A boost shared pointer wrapper for ompl::control::ControlSampler.
bool isValid(const State *state) const
Check if a given state is valid or not.
Definition: SpaceInformation.h:98
geometric::PathGeometric asGeometric() const
Convert this path into a geometric path (interpolation is performed and then states are copied) ...
Definition: PathControl.cpp:94
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...
Definition: SpaceInformation.cpp:129
const ControlSpacePtr & getSubspace(const unsigned int index) const
Get a specific subspace from the compound control space.
Definition: ControlSpace.cpp:157
virtual double length() const
The path length (sum of control durations)
Definition: PathControl.cpp:132
The definition of a discrete control.
Definition: DiscreteControlSpace.h:69
void freeControl(Control *control) const
Free the memory of a control.
Definition: SpaceInformation.h:100
virtual void print(std::ostream &out) const
Print the path to a stream.
Definition: PathControl.cpp:137
A state sampler that only samples valid states, uniformly.
Definition: UniformValidStateSampler.h:50
int value
The current control - an int in range [lowerBound, upperBound].
Definition: DiscreteControlSpace.h:74
double getPropagationStepSize() const
Propagation is performed at integer multiples of a specified step size. This function returns the val...
Definition: SpaceInformation.h:207
std::vector< base::State * > & getStates()
Get the states that make up the path (as a reference, so it can be modified, hence the function is no...
Definition: PathGeometric.h:219
bool randomValid(unsigned int attempts)
Set this path to a random valid segment. Sample attempts times for valid segments. Returns true on success.
Definition: PathControl.cpp:300
StateSamplerPtr allocStateSampler() const
Allocate a uniform state sampler for the state space.
Definition: SpaceInformation.h:264
ControlSamplerPtr allocControlSampler() const
Allocate a control sampler.
Definition: SpaceInformation.h:148
A control space representing the space of applicable controls.
Definition: ControlSpace.h:66
A boost shared pointer wrapper for ompl::base::SpaceInformation.
Representation of a space in which planning can be performed. Topology specific sampling, interpolation and distance are defined.
Definition: StateSpace.h:73
void interpolate()
Make the path such that all controls are applied for a single time step (computes intermediate states...
Definition: PathControl.cpp:190
std::vector< double > controlDurations_
The duration of the control applied at each state. This array contains one element less than the list...
Definition: PathControl.h:199
A boost shared pointer wrapper for ompl::base::OptimizationObjective.
std::vector< base::State * > states_
The list of states that make up the path.
Definition: PathControl.h:193
A control space to allow the composition of control spaces.
Definition: ControlSpace.h:196
virtual bool isCompound() const
Check if the control space is compound.
Definition: ControlSpace.cpp:138
unsigned int getMaxControlDuration() const
Get the maximum number of steps a control is propagated for.
Definition: SpaceInformation.h:167
virtual base::Cost cost(const base::OptimizationObjectivePtr &obj) const
Not yet implemented.
Definition: PathControl.cpp:126
Control * cloneControl(const Control *source) const
Clone a control.
Definition: SpaceInformation.h:112
Space information containing necessary information for planning with controls. setup() needs to be ca...
Definition: SpaceInformation.h:69
void copyFrom(const PathControl &other)
Copy the content of a path to this one.
Definition: PathControl.cpp:111
void printControl(const Control *control, std::ostream &out=std::cout) const
Print a control to a stream.
Definition: SpaceInformation.h:125
std::vector< Control * > controls_
The control applied at each state. This array contains one element less than the list of states...
Definition: PathControl.h:196
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:47
void setNrAttempts(unsigned int attempts)
Finding a valid sample usually requires performing multiple attempts. This call allows setting the nu...
Definition: ValidStateSampler.h:96