All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
RealVectorStateProjections.h
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2010, 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_BASE_SPACES_REAL_VECTOR_STATE_PROJECTIONS_
38 #define OMPL_BASE_SPACES_REAL_VECTOR_STATE_PROJECTIONS_
39 
40 #include "ompl/base/ProjectionEvaluator.h"
41 #include "ompl/base/spaces/RealVectorStateSpace.h"
42 
43 namespace ompl
44 {
45  namespace base
46  {
47 
54  {
55  public:
56 
59  RealVectorLinearProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes,
60  const ProjectionMatrix::Matrix &projection);
61 
64  RealVectorLinearProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes,
65  const ProjectionMatrix::Matrix &projection);
66 
70  const ProjectionMatrix::Matrix &projection);
71 
75  const ProjectionMatrix::Matrix &projection);
76 
77  virtual unsigned int getDimension(void) const;
78 
79  virtual void project(const State *state, EuclideanProjection &projection) const;
80 
81  protected:
82 
85 
86  };
87 
90  {
91  public:
92 
95  RealVectorRandomLinearProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes) :
96  RealVectorLinearProjectionEvaluator(space, cellSizes, ProjectionMatrix::ComputeRandom(space->getDimension(), cellSizes.size()))
97  {
98  }
99 
102  RealVectorRandomLinearProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes) :
103  RealVectorLinearProjectionEvaluator(space, cellSizes, ProjectionMatrix::ComputeRandom(space->getDimension(), cellSizes.size()))
104  {
105  }
106 
109  RealVectorRandomLinearProjectionEvaluator(const StateSpace *space, unsigned int dim) :
110  RealVectorLinearProjectionEvaluator(space, ProjectionMatrix::ComputeRandom(space->getDimension(), dim,
111  space->as<RealVectorStateSpace>()->getBounds().getDifference()))
112  {
113  }
114 
118  RealVectorLinearProjectionEvaluator(space, ProjectionMatrix::ComputeRandom(space->getDimension(), dim,
119  space->as<RealVectorStateSpace>()->getBounds().getDifference()))
120  {
121  }
122 
123  };
124 
127  {
128  public:
129 
132  RealVectorOrthogonalProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes,
133  const std::vector<unsigned int> &components);
134 
137  RealVectorOrthogonalProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes,
138  const std::vector<unsigned int> &components);
139 
142  RealVectorOrthogonalProjectionEvaluator(const StateSpace *space, const std::vector<unsigned int> &components);
143 
146  RealVectorOrthogonalProjectionEvaluator(const StateSpacePtr &space, const std::vector<unsigned int> &components);
147 
148  virtual unsigned int getDimension(void) const;
149 
150  virtual void defaultCellSizes(void);
151 
152  virtual void project(const State *state, EuclideanProjection &projection) const;
153 
154  protected:
155 
157  std::vector<unsigned int> components_;
158 
159  };
160 
163  {
164  public:
165 
168  RealVectorIdentityProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes);
169 
172  RealVectorIdentityProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes);
173 
177 
181 
182  virtual unsigned int getDimension(void) const;
183 
184  virtual void defaultCellSizes(void);
185 
186  virtual void setup(void);
187 
188  virtual void project(const State *state, EuclideanProjection &projection) const;
189 
190  private:
191 
193  std::size_t copySize_;
194 
195  };
196 
197  }
198 }
199 #endif