28 #ifndef CParameterizedTrajectoryGenerator_H
29 #define CParameterizedTrajectoryGenerator_H
40 using namespace mrpt::utils;
55 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
66 void initializeCollisionsGrid(
float refDistance,
float resolution);
81 virtual std::string getDescription()
const = 0 ;
88 void simulateTrajectories(
89 uint16_t alfaValuesCount,
95 float *out_max_acc_v = NULL,
96 float *out_max_acc_w = NULL);
100 virtual void lambdaFunction(
float x,
float y,
int &out_k,
float &out_d );
104 void directionToMotionCommand( uint16_t k,
float &out_v,
float &out_w );
109 void getCPointWhen_d_Is (
float d, uint16_t k,
float &x,
float &y,
float &phi,
float &
t,
float *v = NULL,
float *w = NULL );
119 void allocMemForVerticesData(
int nVertices );
121 void setVertex_xy( uint16_t k,
int n,
int m,
float x,
float y )
123 vertexPoints_x[k][ n*nVertices + m ] = x;
124 vertexPoints_y[k][ n*nVertices + m ] = y;
127 float getVertex_x( uint16_t k,
int n,
int m )
129 int idx = n*nVertices + m;
131 return vertexPoints_x[k][idx];
134 float getVertex_y( uint16_t k,
int n,
int m )
136 int idx = n*nVertices + m;
138 return vertexPoints_y[k][idx];
141 float* getVertixesArray_x( uint16_t k,
int n )
143 int idx = n*nVertices;
144 return &vertexPoints_x[k][idx];
147 float* getVertixesArray_y( uint16_t k,
int n )
149 int idx = n*nVertices;
150 return &vertexPoints_y[k][idx];
162 float index2alfa( uint16_t k )
164 return (
float)(
M_PI * (-1 + 2 * (k+0.5f) / ((
float)alfaValuesCount) ));
170 uint16_t alfa2index(
float alfa )
174 return (uint16_t)(0.5f*(alfaValuesCount*(1+alfa/
M_PI) - 1));
179 void debugDumpInFiles(
int nPT);
206 const TCollisionCell & getTPObstacle(
const float obsX,
const float obsY)
const;
213 void updateCellInfo(
const unsigned int icx,
const unsigned int icy,
const uint16_t k,
const float dist );
220 bool SaveColGridsToFile(
const std::string &filename );
221 bool LoadColGridsFromFile(
const std::string &filename );
228 virtual void PTG_Generator(
float alfa,
float t,
float x,
float y,
float phi,
float &v,
float &w) = 0;
232 virtual bool PTG_IsIntoDomain(
float x,
float y ) = 0;
248 k_min=k_max=n_min=n_max=-1;
288 float x, y, phi,
t, dist,v,w;
305 typedef std::vector<mrpt::reactivenav::CParameterizedTrajectoryGenerator*>
TListPTGs;