Robotics Library  0.6.2
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 <boost/random/mersenne_twister.hpp>
34 #include <boost/random/uniform_real.hpp>
35 #include <boost/random/variate_generator.hpp>
36 
37 #include "Prm.h"
38 
39 namespace rl
40 {
41  namespace plan
42  {
46  class PrmUtilityGuided : public Prm
47  {
48  public:
50 
51  virtual ~PrmUtilityGuided();
52 
53  void construct(const ::std::size_t& steps);
54 
55  ::std::string getName() const;
56 
57  void seed(const ::boost::mt19937::result_type& value);
58 
59  bool solve();
60 
61  private:
62  class Sample
63  {
64  public:
65  Sample(const ::std::size_t& d);
66 
67  virtual ~Sample();
68 
70 
72 
74  };
75 
78  {
79  bool operator()(const Sample* x, const Sample* y) const;
80  };
81 
84 
91 
92  ::std::size_t numNeighbors;
93 
94  ::std::size_t numSamples;
95 
96  ::boost::variate_generator< ::boost::mt19937, ::boost::uniform_real< ::rl::math::Real > > rand;
97 
98  ::std::vector< Sample > samples;
99 
101  };
102  }
103 }
104 
105 #endif // _RL_PLAN_PRMUTILITYGUIDED_H_
rl::plan::PrmUtilityGuided::Sample::d
::rl::math::Real d
Definition: PrmUtilityGuided.h:69
rl::plan::PrmUtilityGuided::numNeighbors
::std::size_t numNeighbors
Definition: PrmUtilityGuided.h:92
Prm.h
rl::plan::PrmUtilityGuided::Sample
Definition: PrmUtilityGuided.h:63
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:154
rl::plan::PrmUtilityGuided::Sample::isColliding
bool isColliding
Definition: PrmUtilityGuided.h:71
rl::plan::PrmUtilityGuided::variance
::rl::math::Real variance
Definition: PrmUtilityGuided.h:100
rl::plan::PrmUtilityGuided::rand
::boost::variate_generator< ::boost::mt19937, ::boost::uniform_real< ::rl::math::Real > > rand
Definition: PrmUtilityGuided.h:96
rl::plan::PrmUtilityGuided::Sample::~Sample
virtual ~Sample()
Definition: PrmUtilityGuided.cpp:221
rl::plan::PrmUtilityGuided::numSamples
::std::size_t numSamples
Definition: PrmUtilityGuided.h:94
rl::plan::PrmUtilityGuided::construct
void construct(const ::std::size_t &steps)
Definition: PrmUtilityGuided.cpp:58
rl::plan::PrmUtilityGuided
Probabilistic Roadmap using Utility-Guided Sampling.
Definition: PrmUtilityGuided.h:47
rl::plan::PrmUtilityGuided::seed
void seed(const ::boost::mt19937::result_type &value)
Definition: PrmUtilityGuided.cpp:192
rl::plan::PrmUtilityGuided::samples
::std::vector< Sample > samples
Definition: PrmUtilityGuided.h:98
rl::plan::PrmUtilityGuided::~PrmUtilityGuided
virtual ~PrmUtilityGuided()
Definition: PrmUtilityGuided.cpp:53
rl::plan::PrmUtilityGuided::CompareSample::operator()
bool operator()(const Sample *x, const Sample *y) const
Definition: PrmUtilityGuided.cpp:226
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:110
rl::plan::Prm
Probabilistic Roadmap.
Definition: Prm.h:51
rl::plan::PrmUtilityGuided::CompareSample
A compare structure for nearest neighbor sorting.
Definition: PrmUtilityGuided.h:78
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:41
rl::plan::PrmUtilityGuided::getName
::std::string getName() const
Definition: PrmUtilityGuided.cpp:186
rl::plan::PrmUtilityGuided::Sample::q
::rl::math::Vector q
Definition: PrmUtilityGuided.h:73
rl::math::Real
double Real
Definition: Real.h:34
rl::plan::PrmUtilityGuided::solve
bool solve()
Find collision free path.
Definition: PrmUtilityGuided.cpp:198
rl::plan::PrmUtilityGuided::Sample::Sample
Sample(const ::std::size_t &d)
Definition: PrmUtilityGuided.cpp:214
rl
Definition: Ati.cpp:35