9 #ifndef CParameterizedTrajectoryGenerator_H
10 #define CParameterizedTrajectoryGenerator_H
22 namespace opengl {
class CSetOfLines; }
56 void initializeCollisionsGrid(
float refDistance,
float resolution);
71 virtual std::string getDescription()
const = 0 ;
78 void simulateTrajectories(
79 uint16_t alphaValuesCount,
85 float *out_max_acc_v = NULL,
86 float *out_max_acc_w = NULL);
98 virtual bool inverseMap_WS2TP(
float x,
float y,
int &out_k,
float &out_d,
float tolerance_dist = 0.10f)
const;
102 void lambdaFunction(
float x,
float y,
int &out_k,
float &out_d )
107 void directionToMotionCommand( uint16_t k,
float &out_v,
float &out_w );
109 uint16_t getAlfaValuesCount()
const {
return m_alphaValuesCount; };
112 void getCPointWhen_d_Is (
float d, uint16_t k,
float &x,
float &y,
float &phi,
float &
t,
float *v = NULL,
float *w = NULL );
131 return (
float)(
M_PI * (-1 + 2 * (k+0.5f) / ((
float)m_alphaValuesCount) ));
141 return (uint16_t)(0.5f*(m_alphaValuesCount*(1+alpha/
M_PI) - 1));
153 bool debugDumpInFiles(
const int nPT);
161 void renderPathAsSimpleLine(
164 const float decimate_distance = 0.1f,
165 const float max_path_distance = 0.0f)
const;
183 :
mrpt::utils::
CDynamicGrid<TCollisionCell>(x_min,x_max,y_min,y_max,resolution),
194 const TCollisionCell & getTPObstacle(
const float obsX,
const float obsY)
const;
201 void updateCellInfo(
const unsigned int icx,
const unsigned int icy,
const uint16_t k,
const float dist );
209 bool SaveColGridsToFile(
const std::string &filename,
const mrpt::math::CPolygon & computed_robotShape );
210 bool LoadColGridsFromFile(
const std::string &filename,
const mrpt::math::CPolygon & current_robotShape );
217 virtual void PTG_Generator(
float alpha,
float t,
float x,
float y,
float phi,
float &v,
float &w) = 0;
221 virtual bool PTG_IsIntoDomain(
float x,
float y ) = 0;
233 k_min(
std::numeric_limits<uint16_t>::max() ),
234 k_max(
std::numeric_limits<uint16_t>::min() ),
235 n_min(
std::numeric_limits<uint32_t>::max() ),
236 n_max(
std::numeric_limits<uint32_t>::min() )
242 bool isEmpty()
const {
return k_min==std::numeric_limits<uint16_t>::max(); }
260 TCPoint(
const float x_,
const float y_,
const float phi_,
261 const float t_,
const float dist_,
262 const float v_,
const float w_) :
263 x(x_), y(y_), phi(phi_),
t(t_), dist(dist_), v(v_), w(w_)
266 float x,
y, phi,
t, dist,v,w;
277 typedef std::vector<mrpt::reactivenav::CParameterizedTrajectoryGenerator*>
TListPTGs;
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
virtual ~CParameterizedTrajectoryGenerator()
Destructor.
float GetCPathPoint_x(uint16_t k, int n) const
#define MRPT_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_STRONG_INLINE const AdjointReturnType t() const
Transpose.
uint16_t alpha2index(float alpha) const
Discrete index value for the corresponding alpha value.
float turningRadiusReference
float GetCPathPoint_d(uint16_t k, int n) const
A wrapper of a TPolygon2D class, implementing CSerializable.
CColisionGrid m_collisionGrid
The collision grid.
This is the base class for any user-defined PTG.
std::vector< TCPointVector > CPoints
std::vector< std::pair< uint16_t, float > > TCollisionCell
A list of all the pairs (alpha,distance) such as the robot collides at that cell. ...
uint16_t m_alphaValuesCount
The number of discrete values for "alpha" between -PI and +PI.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
#define MRPT_DEPRECATED_POST(_MSG)
A 2D grid of dynamic size which stores any kind of data at each cell.
CColisionGrid(float x_min, float x_max, float y_min, float y_max, float resolution, CParameterizedTrajectoryGenerator *parent)
std::vector< mrpt::reactivenav::CParameterizedTrajectoryGenerator * > TListPTGs
A type for lists of PTGs.
An internal class for storing the collision grid.
float GetCPathPoint_t(uint16_t k, int n) const
float GetCPathPoint_w(uint16_t k, int n) const
TCPoint(const float x_, const float y_, const float phi_, const float t_, const float dist_, const float v_, const float w_)
float GetCPathPoint_v(uint16_t k, int n) const
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define REACTIVENAV_IMPEXP
float index2alpha(uint16_t k) const
Alfa value for the discrete corresponding value.
float getMax_V_inTPSpace() const
CParameterizedTrajectoryGenerator const * m_parent
float GetCPathPoint_y(uint16_t k, int n) const
size_t getPointsCountInCPath_k(uint16_t k) const
#define MRPT_DEPRECATED_PRE(_MSG)
CDynamicGrid< TCellForLambdaFunction > m_lambdaFunctionOptimizer
This grid will contain indexes data for speeding-up the default, brute-force lambda function...
A set of independent lines (or segments), one line with its own start and end positions (X...
The trajectories in the C-Space:
float GetCPathPoint_phi(uint16_t k, int n) const
Specifies the min/max values for "k" and "n", respectively.
std::vector< TCPoint > TCPointVector