All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
BKPIECE1.h
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, Rice University,
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 Rice University 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_BKPIECE1_
38 #define OMPL_GEOMETRIC_PLANNERS_KPIECE_BKPIECE1_
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 
77  class BKPIECE1 : public base::Planner
78  {
79  public:
80 
83 
84  virtual ~BKPIECE1(void);
85 
88  void setProjectionEvaluator(const base::ProjectionEvaluatorPtr &projectionEvaluator)
89  {
90  projectionEvaluator_ = projectionEvaluator;
91  }
92 
95  void setProjectionEvaluator(const std::string &name)
96  {
97  projectionEvaluator_ = si_->getStateSpace()->getProjection(name);
98  }
99 
102  {
103  return projectionEvaluator_;
104  }
105 
111  void setRange(double distance)
112  {
113  maxDistance_ = distance;
114  }
115 
117  double getRange(void) const
118  {
119  return maxDistance_;
120  }
121 
128  void setBorderFraction(double bp)
129  {
130  dStart_.setBorderFraction(bp);
131  dGoal_.setBorderFraction(bp);
132  }
133 
136  double getBorderFraction(void) const
137  {
138  return dStart_.getBorderFraction();
139  }
140 
146  {
148  }
149 
153  {
155  }
156 
163  void setMinValidPathFraction(double fraction)
164  {
165  minValidPathFraction_ = fraction;
166  }
167 
169  double getMinValidPathFraction(void) const
170  {
171  return minValidPathFraction_;
172  }
173 
174  virtual void setup(void);
175 
177  virtual void clear(void);
178 
179  virtual void getPlannerData(base::PlannerData &data) const;
180 
181  protected:
182 
184  class Motion
185  {
186  public:
187 
188  Motion(void) : root(NULL), state(NULL), parent(NULL)
189  {
190  }
191 
193  Motion(const base::SpaceInformationPtr &si) : root(NULL), state(si->allocState()), parent(NULL)
194  {
195  }
196 
197  ~Motion(void)
198  {
199  }
200 
203 
206 
209  };
210 
212  void freeMotion(Motion *motion);
213 
216 
219 
222 
225 
230 
237 
239  double maxDistance_;
240 
243 
245  std::pair<base::State*, base::State*> connectionPoint_;
246  };
247 
248  }
249 }
250 
251 
252 #endif