Loading...
Searching...
No Matches
ompl::control::SimpleDirectedControlSampler Class Reference

Implementation of a simple directed control sampler. This is a basic implementation that does not actually take direction into account and builds upon ControlSampler. Instead, a set of k random controls are sampled, and the control that gets the system closest to the target state is returned. More...

#include <ompl/control/SimpleDirectedControlSampler.h>

Inheritance diagram for ompl::control::SimpleDirectedControlSampler:

Public Member Functions

 SimpleDirectedControlSampler (const SpaceInformation *si, unsigned int k=1)
 Constructor takes the state space to construct samples for as argument Optionally, a k value can be given to indicate the number of controls to try when directing a system toward a specific state. Default value is 1. More...
 
unsigned int getNumControlSamples () const
 Retrieve the number of controls to generate when finding the best control. More...
 
void setNumControlSamples (unsigned int numSamples)
 Set the number of controls to generate when finding the best control. More...
 
unsigned int sampleTo (Control *control, const base::State *source, base::State *dest) override
 Sample a control given that it will be applied to state state and the intention is to reach state dest. This is useful for some algorithms that have a notion of direction in their exploration (e.g., cRRT). Furthermore, return the duration for which this control should be applied. The state dest is modified to match the state reached with the computed control and duration. The motion is checked for validity. More...
 
unsigned int sampleTo (Control *control, const Control *previous, const base::State *source, base::State *dest) override
 Sample a control given that it will be applied to state state and the intention is to reach state dest. Also take into account the fact that the previously applied control is previous. This is useful for some algorithms that have a notion of direction in their exploration (e.g., cRRT). Furthermore, return the duration for which this control should be applied. The state dest is modified to match the state reached with the computed control and duration. The motion is checked for validity. More...
 
- Public Member Functions inherited from ompl::control::DirectedControlSampler
 DirectedControlSampler (const DirectedControlSampler &)=delete
 
DirectedControlSampleroperator= (const DirectedControlSampler &)=delete
 
 DirectedControlSampler (const SpaceInformation *si)
 Constructor takes the state space to construct samples for as argument. More...
 
virtual unsigned int sampleTo (Control *control, const base::State *source, base::State *dest)=0
 Sample a control given that it will be applied to state state and the intention is to reach state target. This is useful for some algorithms that have a notion of direction in their exploration (e.g., cRRT). Furthermore, return the duration for which this control should be applied. The state dest is modified to match the state reached with the computed control and duration. The motion is checked for validity. More...
 
virtual unsigned int sampleTo (Control *control, const Control *previous, const base::State *source, base::State *dest)=0
 Sample a control given that it will be applied to state state and the intention is to reach state dest. Also take into account the fact that the previously applied control is previous. This is useful for some algorithms that have a notion of direction in their exploration (e.g., cRRT). Furthermore, return the duration for which this control should be applied. The state dest is modified to match the state reached with the computed control and duration. The motion is checked for validity. More...
 

Protected Member Functions

virtual unsigned int getBestControl (Control *control, const base::State *source, base::State *dest, const Control *previous)
 Samples numControlSamples_ controls, and returns the control that brings the system the closest to target. More...
 

Protected Attributes

ControlSamplerPtr cs_
 An instance of the control sampler. More...
 
unsigned int numControlSamples_
 The number of controls to sample when finding the best control. More...
 
- Protected Attributes inherited from ompl::control::DirectedControlSampler
const SpaceInformationsi_
 The space information this sampler operates on. More...
 

Detailed Description

Implementation of a simple directed control sampler. This is a basic implementation that does not actually take direction into account and builds upon ControlSampler. Instead, a set of k random controls are sampled, and the control that gets the system closest to the target state is returned.

External documentation
K-control sampling is first believed to be proposed in:

S.M. LaValle and J.J. Kuffner, Randomized kinodynamic planning, Intl. J. of Robotics Research, vol. 20, pp. 378–400, May 2001. DOI: 10.1177/02783640122067453
[PDF] [more]

Definition at line 60 of file SimpleDirectedControlSampler.h.

Constructor & Destructor Documentation

◆ SimpleDirectedControlSampler()

ompl::control::SimpleDirectedControlSampler::SimpleDirectedControlSampler ( const SpaceInformation si,
unsigned int  k = 1 
)

Constructor takes the state space to construct samples for as argument Optionally, a k value can be given to indicate the number of controls to try when directing a system toward a specific state. Default value is 1.

Definition at line 40 of file SimpleDirectedControlSampler.cpp.

Member Function Documentation

◆ getBestControl()

unsigned int ompl::control::SimpleDirectedControlSampler::getBestControl ( Control control,
const base::State source,
base::State dest,
const Control previous 
)
protectedvirtual

Samples numControlSamples_ controls, and returns the control that brings the system the closest to target.

Definition at line 59 of file SimpleDirectedControlSampler.cpp.

◆ getNumControlSamples()

unsigned int ompl::control::SimpleDirectedControlSampler::getNumControlSamples ( ) const
inline

Retrieve the number of controls to generate when finding the best control.

Definition at line 71 of file SimpleDirectedControlSampler.h.

◆ sampleTo() [1/2]

unsigned int ompl::control::SimpleDirectedControlSampler::sampleTo ( Control control,
const base::State source,
base::State dest 
)
overridevirtual

Sample a control given that it will be applied to state state and the intention is to reach state dest. This is useful for some algorithms that have a notion of direction in their exploration (e.g., cRRT). Furthermore, return the duration for which this control should be applied. The state dest is modified to match the state reached with the computed control and duration. The motion is checked for validity.

Implements ompl::control::DirectedControlSampler.

Definition at line 47 of file SimpleDirectedControlSampler.cpp.

◆ sampleTo() [2/2]

unsigned int ompl::control::SimpleDirectedControlSampler::sampleTo ( Control control,
const Control previous,
const base::State source,
base::State dest 
)
overridevirtual

Sample a control given that it will be applied to state state and the intention is to reach state dest. Also take into account the fact that the previously applied control is previous. This is useful for some algorithms that have a notion of direction in their exploration (e.g., cRRT). Furthermore, return the duration for which this control should be applied. The state dest is modified to match the state reached with the computed control and duration. The motion is checked for validity.

Implements ompl::control::DirectedControlSampler.

Definition at line 53 of file SimpleDirectedControlSampler.cpp.

◆ setNumControlSamples()

void ompl::control::SimpleDirectedControlSampler::setNumControlSamples ( unsigned int  numSamples)
inline

Set the number of controls to generate when finding the best control.

Definition at line 77 of file SimpleDirectedControlSampler.h.

Member Data Documentation

◆ cs_

ControlSamplerPtr ompl::control::SimpleDirectedControlSampler::cs_
protected

An instance of the control sampler.

Definition at line 112 of file SimpleDirectedControlSampler.h.

◆ numControlSamples_

unsigned int ompl::control::SimpleDirectedControlSampler::numControlSamples_
protected

The number of controls to sample when finding the best control.

Definition at line 115 of file SimpleDirectedControlSampler.h.


The documentation for this class was generated from the following files: