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 <SimpleDirectedControlSampler.h>
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. | |
unsigned int | getNumControlSamples (void) const |
Retrieve the number of controls to generate when finding the best control. | |
void | setNumControlSamples (unsigned int numSamples) |
Set the number of controls to generate when finding the best control. | |
virtual unsigned int | sampleTo (Control *control, const base::State *source, const base::State *target) |
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. By default, this function calls the second definition of ControlSampler::sample() and returns the value of ControlSampler::sampleStepCount(SpaceInformation::getMinControlDuration(), SpaceInformation::getMaxControlDuration()). | |
virtual unsigned int | sampleTo (Control *control, const Control *previous, const base::State *source, const base::State *target) |
Sample a control given that it will be applied to state state and the intention is to reach state target. 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. By default, this function calls the second definition of ControlSampler::sampleNext() and returns the value of ControlSampler::sampleStepCount(SpaceInformation::getMinControlDuration(), SpaceInformation::getMaxControlDuration()). | |
![]() | |
DirectedControlSampler (const SpaceInformation *si) | |
Constructor takes the state space to construct samples for as argument. | |
Protected Member Functions | |
virtual unsigned int | getBestControl (Control *control, const base::State *source, const base::State *target, const Control *previous) |
Samples numControlSamples_ controls, and returns the control that brings the system the closest to target. | |
Protected Attributes | |
ControlSamplerPtr | cs_ |
An instance of the control sampler. | |
unsigned int | numControlSamples_ |
The number of controls to sample when finding the best control. | |
![]() | |
const SpaceInformation * | si_ |
The space information this sampler operates on. | |
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.
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.