Robotics Library  0.7.0
Eet.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009, Markus Rickert
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 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 // POSSIBILITY OF SUCH DAMAGE.
25 //
26 
27 #ifndef RL_PLAN_EET_H
28 #define RL_PLAN_EET_H
29 
30 #include <random>
32 
33 #include "RrtCon.h"
34 #include "WorkspaceMetric.h"
35 
36 namespace rl
37 {
38  namespace plan
39  {
40  class WorkspaceSphereExplorer;
41 
51  class Eet : public RrtCon
52  {
53  public:
55  {
58 
60  int goalFrame;
61 
64 
67  };
68 
69  Eet();
70 
71  virtual ~Eet();
72 
73  ::std::chrono::steady_clock::duration getExplorationDuration() const;
74 
75  virtual ::std::string getName() const;
76 
77  virtual ::std::size_t getNumEdges() const;
78 
79  virtual ::std::size_t getNumVertices() const;
80 
82 
83  void seed(const ::std::mt19937::result_type& value);
84 
85  void reset();
86 
87  bool solve();
88 
91 
94 
97 
100 
101  ::std::vector<WorkspaceSphereExplorer*> explorers;
102 
103  ::std::vector<ExplorerSetup> explorersSetup;
104 
107 
110 
113 
116 
119 
120  protected:
122  {
124  };
125 
126  Edge addEdge(const Vertex& u, const Vertex& v, Tree& tree);
127 
128  Vertex addVertex(Tree& tree, const VectorPtr& q);
129 
130  using RrtCon::connect;
131 
133 
135 
137 
138  using RrtCon::extend;
139 
141 
142  ::std::normal_distribution< ::rl::math::Real>::result_type gauss();
143 
144  static VertexBundle* get(const Tree& tree, const Vertex& v);
145 
146  using RrtCon::nearest;
147 
149 
150  ::std::uniform_real_distribution< ::rl::math::Real>::result_type rand();
151 
152  ::std::normal_distribution< ::rl::math::Real> gaussDistribution;
153 
154  ::std::mt19937 gaussEngine;
155 
156  ::std::uniform_real_distribution< ::rl::math::Real> randDistribution;
157 
158  ::std::mt19937 randEngine;
159 
160  private:
161  ::std::chrono::steady_clock::time_point explorationTimeStart;
162 
163  ::std::chrono::steady_clock::time_point explorationTimeStop;
164 
166  };
167  }
168 }
169 
170 #endif // RL_PLAN_EET_H
rl::plan::Eet::getNumEdges
virtual ::std::size_t getNumEdges() const
Definition: Eet.cpp:280
rl::plan::Rrt::Edge
::boost::graph_traits< Tree >::edge_descriptor Edge
Definition: Rrt.h:119
RrtCon.h
rl::plan::Eet::Eet
Eet()
Definition: Eet.cpp:53
rl::plan::Eet::~Eet
virtual ~Eet()
Definition: Eet.cpp:76
rl::math::Transform
::Eigen::Transform< Real, 3, ::Eigen::Affine > Transform
Rigid transformation in 3D.
Definition: Transform.h:46
rl::plan::Eet::explorers
::std::vector< WorkspaceSphereExplorer * > explorers
Definition: Eet.h:101
rl::plan::Eet::seed
void seed(const ::std::mt19937::result_type &value)
Definition: Eet.cpp:324
rl::plan::Eet::gauss
::std::normal_distribution< ::rl::math::Real >::result_type gauss()
Definition: Eet.cpp:256
rl::plan::Eet::gamma
::rl::math::Real gamma
Initialization value for exploration/exploitation balance.
Definition: Eet.h:106
rl::plan::Eet::nearest
Neighbor nearest(const Tree &tree, const ::rl::math::Transform &chosen)
Definition: Eet.cpp:298
rl::plan::TransformPtr
::std::shared_ptr< ::rl::math::Transform > TransformPtr
Definition: TransformPtr.h:37
rl::plan::Eet::randEngine
::std::mt19937 randEngine
Definition: Eet.h:158
rl::plan::Eet::get
static VertexBundle * get(const Tree &tree, const Vertex &v)
Definition: Eet.cpp:262
rl::plan::Eet::reset
void reset()
Reset planner.
Definition: Eet.cpp:311
rl::plan::Eet::distanceWeight
::rl::math::Real distanceWeight
Weight factor translation vs. orientation.
Definition: Eet.h:99
rl::math::Vector3
::Eigen::Matrix< Real, 3, 1 > Vector3
Definition: Vector.h:46
rl::plan::Eet::ExplorerSetup::goalFrame
int goalFrame
Goal frame for workspace explorer in goal configuration reference.
Definition: Eet.h:60
rl::plan::Rrt::connect
virtual Vertex connect(Tree &tree, const Neighbor &nearest, const ::rl::math::Vector &chosen)
Definition: Rrt.cpp:107
rl::plan::Eet::alpha
::rl::math::Real alpha
Control increase/decrease of exploitation.
Definition: Eet.h:90
rl::plan::Eet::max
::rl::math::Vector3 max
Upper workspace limit for workspace frame sampling.
Definition: Eet.h:115
rl::plan::VectorList
::std::list< ::rl::math::Vector > VectorList
Definition: VectorList.h:37
GnatNearestNeighbors.h
rl::plan::Eet::ExplorerSetup
Definition: Eet.h:55
rl::plan::Eet::expand
int expand(const VertexBundle *nearest, const ::rl::math::Transform &nearest2, const ::rl::math::Transform &chosen, const ::rl::math::Real &distance, VertexBundle &expanded)
Definition: Eet.cpp:174
rl::plan::Eet::goalEpsilon
::rl::math::Real goalEpsilon
Epsilon for goal state.
Definition: Eet.h:109
rl::math::Vector
::Eigen::Matrix< Real, ::Eigen::Dynamic, 1 > Vector
Definition: Vector.h:42
rl::plan::Eet::beta
::rl::math::Real beta
Threshold for switching to uniform orientation sampling.
Definition: Eet.h:96
rl::plan::Rrt::Tree
::boost::adjacency_list< ::boost::listS, ::boost::listS, ::boost::bidirectionalS, ::std::shared_ptr< VertexBundle >, ::boost::no_property, TreeBundle > Tree
Definition: Rrt.h:96
rl::plan::Eet::getNumVertices
virtual ::std::size_t getNumVertices() const
Definition: Eet.cpp:286
rl::plan::Rrt::VertexBundle
Definition: Rrt.h:90
rl::plan::Eet::min
::rl::math::Vector3 min
Lower workspace limit for workspace frame sampling.
Definition: Eet.h:118
WorkspaceMetric.h
rl::plan::Eet::ExplorerSetup::startFrame
int startFrame
Start frame for workspace explorer in start configuration reference.
Definition: Eet.h:66
rl::plan::Rrt::tree
::std::vector< Tree > tree
Definition: Rrt.h:151
rl::plan::Rrt::Vertex
::boost::adjacency_list_traits< ::boost::listS, ::boost::listS, ::boost::bidirectionalS, ::boost::listS >::vertex_descriptor Vertex
Definition: Rrt.h:112
rl::plan::Eet::gaussEngine
::std::mt19937 gaussEngine
Definition: Eet.h:154
rl::plan::Eet::randDistribution
::std::uniform_real_distribution< ::rl::math::Real > randDistribution
Definition: Eet.h:156
rl::plan::Rrt::nearest
virtual Neighbor nearest(const Tree &tree, const ::rl::math::Vector &chosen)
Definition: Rrt.cpp:265
rl::math::GnatNearestNeighbors
Geometric Near-Neighbor Access Tree (GNAT).
Definition: GnatNearestNeighbors.h:54
rl::plan::Eet::addVertex
Vertex addVertex(Tree &tree, const VectorPtr &q)
Definition: Eet.cpp:94
rl::plan::Eet::ExplorerSetup::startConfiguration
::rl::math::Vector * startConfiguration
Start configuration reference for workspace explorer setup.
Definition: Eet.h:63
rl::plan::Eet::explorersSetup
::std::vector< ExplorerSetup > explorersSetup
Definition: Eet.h:103
rl::plan::Eet::solve
bool solve()
Find collision free path.
Definition: Eet.cpp:332
rl::plan::Rrt::Neighbor
::std::pair< ::rl::math::Real, Vertex > Neighbor
Definition: Rrt.h:125
rl::plan::Eet::getPath
VectorList getPath()
Get solution path.
Definition: Eet.cpp:292
rl::plan::Eet::rand
::std::uniform_real_distribution< ::rl::math::Real >::result_type rand()
Definition: Eet.cpp:305
rl::plan::Rrt::extend
virtual Vertex extend(Tree &tree, const Neighbor &nearest, const ::rl::math::Vector &chosen)
Definition: Rrt.cpp:180
rl::plan::Eet::distance
::rl::math::Real distance(const ::rl::math::Transform &t1, const ::rl::math::Transform &t2) const
Definition: Eet.cpp:160
rl::plan::Eet::extend
Vertex extend(Tree &tree, const Neighbor &nearest, const ::rl::math::Transform &chosen)
Definition: Eet.cpp:235
rl::plan::Eet::getExplorationDuration
::std::chrono::steady_clock::duration getExplorationDuration() const
Definition: Eet.cpp:268
rl::plan::Eet::ExplorerSetup::goalConfiguration
::rl::math::Vector * goalConfiguration
Goal configuration reference for workspace explorer setup.
Definition: Eet.h:57
rl::plan::Eet::goalEpsilonUseOrientation
bool goalEpsilonUseOrientation
Include frame orientation in goal epsilon calculation.
Definition: Eet.h:112
rl::plan::Eet::explorationTimeStop
::std::chrono::steady_clock::time_point explorationTimeStop
Definition: Eet.h:163
rl::plan::RrtCon
RRT-Connect1.
Definition: RrtCon.h:47
rl::plan::VectorPtr
::std::shared_ptr< ::rl::math::Vector > VectorPtr
Definition: VectorPtr.h:37
rl::plan::Eet::gaussDistribution
::std::normal_distribution< ::rl::math::Real > gaussDistribution
Definition: Eet.h:152
rl::plan::Eet::explorationTimeStart
::std::chrono::steady_clock::time_point explorationTimeStart
Definition: Eet.h:161
rl::math::Real
double Real
Definition: Real.h:42
rl::plan::Eet::VertexBundle::t
TransformPtr t
Definition: Eet.h:123
rl::plan::Eet::alternativeDistanceComputation
bool alternativeDistanceComputation
Better performance in certain scenarios.
Definition: Eet.h:93
rl::plan::Eet::addEdge
Edge addEdge(const Vertex &u, const Vertex &v, Tree &tree)
Definition: Eet.cpp:81
rl::plan::Eet
Exploring/Exploiting Trees.
Definition: Eet.h:52
rl::plan::Eet::connect
Vertex connect(Tree &tree, const Neighbor &nearest, const ::rl::math::Transform &chosen)
Definition: Eet.cpp:112
rl::plan::Eet::getName
virtual ::std::string getName() const
Definition: Eet.cpp:274
rl::plan::Eet::nn
::rl::math::GnatNearestNeighbors< WorkspaceMetric > nn
Definition: Eet.h:165
rl::plan::Eet::VertexBundle
Definition: Eet.h:122
rl
Robotics Library.
Definition: AnalogInput.cpp:30