Robotics Library  0.7.0
PrmUtilityGuided.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2011, Arne Sieverling
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // * Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright notice,
11 // this list of conditions and the following disclaimer in the documentation
12 // and/or other materials provided with the distribution.
13 // * Neither the name of the Technische Universitaet Muenchen nor the names of
14 // its contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 // POSSIBILITY OF SUCH DAMAGE.
28 //
29 
30 #ifndef RL_PLAN_PRMUTILITYGUIDED_H
31 #define RL_PLAN_PRMUTILITYGUIDED_H
32 
33 #include <random>
34 
35 #include "Prm.h"
36 
37 namespace rl
38 {
39  namespace plan
40  {
50  class PrmUtilityGuided : public Prm
51  {
52  public:
54 
55  virtual ~PrmUtilityGuided();
56 
57  void construct(const ::std::size_t& steps);
58 
59  ::std::string getName() const;
60 
61  void seed(const ::std::mt19937::result_type& value);
62 
63  bool solve();
64 
65  protected:
66 
67  private:
68  class Sample
69  {
70  public:
71  Sample(const ::std::size_t& d);
72 
73  virtual ~Sample();
74 
76 
78 
80 
81  protected:
82 
83  private:
84 
85  };
86 
89  {
90  bool operator()(const Sample* x, const Sample* y) const;
91  };
92 
98 
105 
106  ::std::uniform_real_distribution< ::rl::math::Real>::result_type rand();
107 
108  ::std::size_t numNeighbors;
109 
110  ::std::size_t numSamples;
111 
112  ::std::uniform_real_distribution< ::rl::math::Real> randDistribution;
113 
114  ::std::mt19937 randEngine;
115 
116  ::std::vector<Sample> samples;
117 
119  };
120  }
121 }
122 
123 #endif // RL_PLAN_PRMUTILITYGUIDED_H
rl::plan::PrmUtilityGuided::randEngine
::std::mt19937 randEngine
Definition: PrmUtilityGuided.h:114
rl::plan::PrmUtilityGuided::Sample::d
::rl::math::Real d
Definition: PrmUtilityGuided.h:75
rl::plan::PrmUtilityGuided::numNeighbors
::std::size_t numNeighbors
Definition: PrmUtilityGuided.h:108
Prm.h
rl::plan::PrmUtilityGuided::samples
::std::vector< Sample > samples
Definition: PrmUtilityGuided.h:116
rl::plan::PrmUtilityGuided::Sample
Definition: PrmUtilityGuided.h:69
rl::plan::PrmUtilityGuided::PrmUtilityGuided
PrmUtilityGuided()
Definition: PrmUtilityGuided.cpp:41
rl::plan::PrmUtilityGuided::getFreeProbability
::rl::math::Real getFreeProbability(const Sample &sample)
Get an estimated probability that a sample is not colliding with the scene.
Definition: PrmUtilityGuided.cpp:152
rl::plan::PrmUtilityGuided::Sample::isColliding
bool isColliding
Definition: PrmUtilityGuided.h:77
rl::plan::PrmUtilityGuided::seed
void seed(const ::std::mt19937::result_type &value)
Definition: PrmUtilityGuided.cpp:196
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::plan::PrmUtilityGuided::variance
::rl::math::Real variance
Definition: PrmUtilityGuided.h:118
rl::plan::PrmUtilityGuided::randDistribution
::std::uniform_real_distribution< ::rl::math::Real > randDistribution
Definition: PrmUtilityGuided.h:112
rl::plan::PrmUtilityGuided::Sample::~Sample
virtual ~Sample()
Definition: PrmUtilityGuided.cpp:225
rl::plan::PrmUtilityGuided::numSamples
::std::size_t numSamples
Definition: PrmUtilityGuided.h:110
rl::plan::PrmUtilityGuided::construct
void construct(const ::std::size_t &steps)
Definition: PrmUtilityGuided.cpp:56
rl::plan::PrmUtilityGuided
Probabilistic Roadmaps with Utility-Guided Sampling.
Definition: PrmUtilityGuided.h:51
rl::plan::PrmUtilityGuided::rand
::std::uniform_real_distribution< ::rl::math::Real >::result_type rand()
Definition: PrmUtilityGuided.cpp:190
rl::plan::PrmUtilityGuided::~PrmUtilityGuided
virtual ~PrmUtilityGuided()
Definition: PrmUtilityGuided.cpp:51
rl::plan::PrmUtilityGuided::CompareSample::operator()
bool operator()(const Sample *x, const Sample *y) const
Definition: PrmUtilityGuided.cpp:230
rl::plan::PrmUtilityGuided::generateEntropyGuidedSample
void generateEntropyGuidedSample(::rl::math::Vector &q)
Samples a point near the middle (+/- variance) of two random nodes from unconnected components of the...
Definition: PrmUtilityGuided.cpp:108
rl::plan::Prm
Probabilistic Roadmaps.
Definition: Prm.h:65
rl::plan::PrmUtilityGuided::CompareSample
A compare structure for nearest neighbor sorting.
Definition: PrmUtilityGuided.h:89
rl::plan::PrmUtilityGuided::getName
::std::string getName() const
Definition: PrmUtilityGuided.cpp:184
rl::plan::PrmUtilityGuided::Sample::q
::rl::math::Vector q
Definition: PrmUtilityGuided.h:79
rl::math::Real
double Real
Definition: Real.h:42
rl::plan::PrmUtilityGuided::solve
bool solve()
Find collision free path.
Definition: PrmUtilityGuided.cpp:202
rl::plan::PrmUtilityGuided::Sample::Sample
Sample(const ::std::size_t &d)
Definition: PrmUtilityGuided.cpp:218
rl
Robotics Library.
Definition: AnalogInput.cpp:30