9 #ifndef CParameterizedTrajectoryGenerator_H
10 #define CParameterizedTrajectoryGenerator_H
22 namespace opengl {
class CSetOfLines; }
54 void initializeCollisionsGrid(
float refDistance,
float resolution);
69 virtual std::string getDescription()
const = 0 ;
76 void simulateTrajectories(
77 uint16_t alphaValuesCount,
83 float *out_max_acc_v = NULL,
84 float *out_max_acc_w = NULL);
96 virtual bool inverseMap_WS2TP(
float x,
float y,
int &out_k,
float &out_d,
float tolerance_dist = 0.10f)
const;
100 "Use inverseMap_WS2TP() instead", \
101 void lambdaFunction(
float x,
float y,
int &out_k,
float &out_d ); \
106 void directionToMotionCommand( uint16_t k,
float &out_v,
float &out_w );
111 void getCPointWhen_d_Is (
float d, uint16_t k,
float &x,
float &y,
float &phi,
float &
t,
float *v = NULL,
float *w = NULL );
130 return (
float)(
M_PI * (-1 + 2 * (k+0.5f) / ((
float)m_alphaValuesCount) ));
140 return (uint16_t)(0.5f*(m_alphaValuesCount*(1+alpha/
M_PI) - 1));
152 bool debugDumpInFiles(
const int nPT);
160 void renderPathAsSimpleLine(
163 const float decimate_distance = 0.1f,
164 const float max_path_distance = 0.0f)
const;
182 :
mrpt::utils::CDynamicGrid<TCollisionCell>(x_min,x_max,y_min,y_max,resolution),
193 const TCollisionCell & getTPObstacle(
const float obsX,
const float obsY)
const;
200 void updateCellInfo(
const unsigned int icx,
const unsigned int icy,
const uint16_t k,
const float dist );
208 bool SaveColGridsToFile(
const std::string &filename,
const mrpt::math::CPolygon & computed_robotShape );
209 bool LoadColGridsFromFile(
const std::string &filename,
const mrpt::math::CPolygon & current_robotShape );
216 virtual void PTG_Generator(
float alpha,
float t,
float x,
float y,
float phi,
float &v,
float &w) = 0;
220 virtual bool PTG_IsIntoDomain(
float x,
float y ) = 0;
232 k_min(
std::numeric_limits<uint16_t>::max() ),
233 k_max(
std::numeric_limits<uint16_t>::min() ),
234 n_min(
std::numeric_limits<uint32_t>::max() ),
235 n_max(
std::numeric_limits<uint32_t>::min() )
241 bool isEmpty()
const {
return k_min==std::numeric_limits<uint16_t>::max(); }
259 TCPoint(
const float x_,
const float y_,
const float phi_,
260 const float t_,
const float dist_,
261 const float v_,
const float w_) :
262 x(x_), y(y_), phi(phi_),
t(t_), dist(dist_), v(v_), w(w_)
265 float x,
y, phi,
t, dist,v,w;
276 typedef std::vector<mrpt::nav::CParameterizedTrajectoryGenerator*>
TListPTGs;
float GetCPathPoint_w(uint16_t k, int n) const
std::vector< std::pair< uint16_t, float > > TCollisionCell
A list of all the pairs (alpha,distance) such as the robot collides at that cell. ...
float GetCPathPoint_phi(uint16_t k, int n) const
mrpt::utils::CDynamicGrid< TCellForLambdaFunction > m_lambdaFunctionOptimizer
This grid will contain indexes data for speeding-up the default, brute-force lambda function...
float GetCPathPoint_v(uint16_t k, int n) const
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_STRONG_INLINE const AdjointReturnType t() const
Transpose.
float index2alpha(uint16_t k) const
Alfa value for the discrete corresponding value.
std::vector< TCPointVector > CPoints
A wrapper of a TPolygon2D class, implementing CSerializable.
float GetCPathPoint_t(uint16_t k, int n) const
The trajectories in the C-Space:
float turningRadiusReference
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This is the base class for any user-defined PTG.
A 2D grid of dynamic size which stores any kind of data at each cell.
float GetCPathPoint_x(uint16_t k, int n) const
std::vector< TCPoint > TCPointVector
#define MRPT_DECLARE_DEPRECATED_FUNCTION(__MSG, __FUNC)
Usage: MRPT_DECLARE_DEPRECATED_FUNCTION("Use XX instead", void myFunc(double));.
CColisionGrid m_collisionGrid
The collision grid.
float GetCPathPoint_d(uint16_t k, int n) const
uint16_t getAlfaValuesCount() const
An internal class for storing the collision grid.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
size_t getPointsCountInCPath_k(uint16_t k) const
float getMax_V_inTPSpace() const
uint16_t alpha2index(float alpha) const
Discrete index value for the corresponding alpha value.
CColisionGrid(float x_min, float x_max, float y_min, float y_max, float resolution, CParameterizedTrajectoryGenerator *parent)
Specifies the min/max values for "k" and "n", respectively.
A set of independent lines (or segments), one line with its own start and end positions (X...
virtual ~CParameterizedTrajectoryGenerator()
Destructor.
float GetCPathPoint_y(uint16_t k, int n) const
std::vector< mrpt::nav::CParameterizedTrajectoryGenerator * > TListPTGs
A type for lists of PTGs.
uint16_t m_alphaValuesCount
The number of discrete values for "alpha" between -PI and +PI.
TCPoint(const float x_, const float y_, const float phi_, const float t_, const float dist_, const float v_, const float w_)
CParameterizedTrajectoryGenerator const * m_parent