00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef OMPL_BASE_SPACES_REAL_VECTOR_STATE_PROJECTIONS_
00038 #define OMPL_BASE_SPACES_REAL_VECTOR_STATE_PROJECTIONS_
00039
00040 #include "ompl/base/ProjectionEvaluator.h"
00041 #include "ompl/base/spaces/RealVectorStateSpace.h"
00042
00043 namespace ompl
00044 {
00045 namespace base
00046 {
00047
00053 class RealVectorLinearProjectionEvaluator : public ProjectionEvaluator
00054 {
00055 public:
00056
00059 RealVectorLinearProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes,
00060 const ProjectionMatrix::Matrix &projection);
00061
00064 RealVectorLinearProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes,
00065 const ProjectionMatrix::Matrix &projection);
00066
00069 RealVectorLinearProjectionEvaluator(const StateSpace *space,
00070 const ProjectionMatrix::Matrix &projection);
00071
00074 RealVectorLinearProjectionEvaluator(const StateSpacePtr &space,
00075 const ProjectionMatrix::Matrix &projection);
00076
00077 virtual unsigned int getDimension(void) const;
00078
00079 virtual void project(const State *state, EuclideanProjection &projection) const;
00080
00081 protected:
00082
00084 ProjectionMatrix projection_;
00085
00086 };
00087
00089 class RealVectorRandomLinearProjectionEvaluator : public RealVectorLinearProjectionEvaluator
00090 {
00091 public:
00092
00095 RealVectorRandomLinearProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes) :
00096 RealVectorLinearProjectionEvaluator(space, cellSizes, ProjectionMatrix::ComputeRandom(space->getDimension(), cellSizes.size()))
00097 {
00098 }
00099
00102 RealVectorRandomLinearProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes) :
00103 RealVectorLinearProjectionEvaluator(space, cellSizes, ProjectionMatrix::ComputeRandom(space->getDimension(), cellSizes.size()))
00104 {
00105 }
00106
00109 RealVectorRandomLinearProjectionEvaluator(const StateSpace *space, unsigned int dim) :
00110 RealVectorLinearProjectionEvaluator(space, ProjectionMatrix::ComputeRandom(space->getDimension(), dim,
00111 space->as<RealVectorStateSpace>()->getBounds().getDifference()))
00112 {
00113 }
00114
00117 RealVectorRandomLinearProjectionEvaluator(const StateSpacePtr &space, unsigned int dim) :
00118 RealVectorLinearProjectionEvaluator(space, ProjectionMatrix::ComputeRandom(space->getDimension(), dim,
00119 space->as<RealVectorStateSpace>()->getBounds().getDifference()))
00120 {
00121 }
00122
00123 };
00124
00126 class RealVectorOrthogonalProjectionEvaluator : public ProjectionEvaluator
00127 {
00128 public:
00129
00132 RealVectorOrthogonalProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes,
00133 const std::vector<unsigned int> &components);
00134
00137 RealVectorOrthogonalProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes,
00138 const std::vector<unsigned int> &components);
00139
00142 RealVectorOrthogonalProjectionEvaluator(const StateSpace *space, const std::vector<unsigned int> &components);
00143
00146 RealVectorOrthogonalProjectionEvaluator(const StateSpacePtr &space, const std::vector<unsigned int> &components);
00147
00148 virtual unsigned int getDimension(void) const;
00149
00150 virtual void defaultCellSizes(void);
00151
00152 virtual void project(const State *state, EuclideanProjection &projection) const;
00153
00154 protected:
00155
00157 std::vector<unsigned int> components_;
00158
00159 };
00160
00162 class RealVectorIdentityProjectionEvaluator : public ProjectionEvaluator
00163 {
00164 public:
00165
00168 RealVectorIdentityProjectionEvaluator(const StateSpace *space, const std::vector<double> &cellSizes);
00169
00172 RealVectorIdentityProjectionEvaluator(const StateSpacePtr &space, const std::vector<double> &cellSizes);
00173
00176 RealVectorIdentityProjectionEvaluator(const StateSpace *space);
00177
00180 RealVectorIdentityProjectionEvaluator(const StateSpacePtr &space);
00181
00182 virtual unsigned int getDimension(void) const;
00183
00184 virtual void defaultCellSizes(void);
00185
00186 virtual void setup(void);
00187
00188 virtual void project(const State *state, EuclideanProjection &projection) const;
00189
00190 private:
00191
00193 std::size_t copySize_;
00194
00195 };
00196
00197 }
00198 }
00199 #endif