All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
KPIECE1.h
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Willow Garage nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 /* Author: Ioan Sucan */
36 
37 #ifndef OMPL_GEOMETRIC_PLANNERS_KPIECE_KPIECE1_
38 #define OMPL_GEOMETRIC_PLANNERS_KPIECE_KPIECE1_
39 
40 #include "ompl/geometric/planners/PlannerIncludes.h"
41 #include "ompl/geometric/planners/kpiece/Discretization.h"
42 
43 namespace ompl
44 {
45 
46  namespace geometric
47  {
48 
49 
74  class KPIECE1 : public base::Planner
75  {
76  public:
77 
80 
81  virtual ~KPIECE1(void);
82 
84 
85  virtual void clear(void);
86 
96  void setGoalBias(double goalBias)
97  {
98  goalBias_ = goalBias;
99  }
100 
102  double getGoalBias(void) const
103  {
104  return goalBias_;
105  }
106 
112  void setRange(double distance)
113  {
114  maxDistance_ = distance;
115  }
116 
118  double getRange(void) const
119  {
120  return maxDistance_;
121  }
122 
129  void setBorderFraction(double bp)
130  {
131  disc_.setBorderFraction(bp);
132  }
133 
136  double getBorderFraction(void) const
137  {
138  return disc_.getBorderFraction();
139  }
140 
147  void setMinValidPathFraction(double fraction)
148  {
149  minValidPathFraction_ = fraction;
150  }
151 
153  double getMinValidPathFraction(void) const
154  {
155  return minValidPathFraction_;
156  }
157 
163  {
165  }
166 
170  {
172  }
173 
176  void setProjectionEvaluator(const base::ProjectionEvaluatorPtr &projectionEvaluator)
177  {
178  projectionEvaluator_ = projectionEvaluator;
179  }
180 
183  void setProjectionEvaluator(const std::string &name)
184  {
185  projectionEvaluator_ = si_->getStateSpace()->getProjection(name);
186  }
187 
190  {
191  return projectionEvaluator_;
192  }
193 
194  virtual void setup(void);
195 
196  virtual void getPlannerData(base::PlannerData &data) const;
197 
198  protected:
199 
201  class Motion
202  {
203  public:
204 
205  Motion(void) : state(NULL), parent(NULL)
206  {
207  }
208 
210  Motion(const base::SpaceInformationPtr &si) : state(si->allocState()), parent(NULL)
211  {
212  }
213 
214  ~Motion(void)
215  {
216  }
217 
220 
223  };
224 
226  void freeMotion(Motion *motion);
227 
230 
233 
238 
243 
245  double goalBias_;
246 
253 
255  double maxDistance_;
256 
259 
262  };
263 
264  }
265 }
266 
267 #endif