MRPT logo

mrpt::reactivenav::CParameterizedTrajectoryGenerator Class Reference

This is the base class for any user defined PTG. More...

#include <mrpt/reactivenav/CParameterizedTrajectoryGenerator.h>

Inheritance diagram for mrpt::reactivenav::CParameterizedTrajectoryGenerator:

mrpt::reactivenav::CPTG1 mrpt::reactivenav::CPTG2 mrpt::reactivenav::CPTG3 mrpt::reactivenav::CPTG4 mrpt::reactivenav::CPTG5 mrpt::reactivenav::CPTG6 mrpt::reactivenav::CPTG7

List of all members.

Classes

class  CColisionGrid
 An internal class for storing the collision grid. More...
struct  TCellForLambdaFunction
 Specifies the min/max values for "k" and "n", respectively. More...
struct  TCPoint
 The trajectories in the C-Space:. More...

Public Types

typedef std::map< uint16_t, float > TCollisionCell
 A list of all the pairs (alpha,distance) such as the robot collides at that cell.

Public Member Functions

virtual std::string getDescription ()=0
 Gets a short textual description of the PTG and its parameters.
virtual ~CParameterizedTrajectoryGenerator ()
 Destructor.
void simulateTrajectories (uint16_t alfaValuesCount, float max_time, float max_dist, unsigned int max_n, float diferencial_t, float min_dist, float *out_max_acc_v=NULL, float *out_max_acc_w=NULL)
 The main method: solves the diferential equation to generate a family of parametrical trajectories.
virtual void lambdaFunction (float x, float y, int &out_k, float &out_d)
 The "lambda" function, see paper for info.
void directionToMotionCommand (uint16_t k, float &out_v, float &out_w)
 Converts an "alfa" value (into the discrete set) into a feasible motion command.
size_t getAlfaValuesCount ()
size_t getPointsCountInCPath_k (uint16_t k)
void getCPointWhen_d_Is (float d, uint16_t k, float &x, float &y, float &phi, float &t, float *v=NULL, float *w=NULL)
float GetCPathPoint_x (uint16_t k, int n)
float GetCPathPoint_y (uint16_t k, int n)
float GetCPathPoint_phi (uint16_t k, int n)
float GetCPathPoint_t (uint16_t k, int n)
float GetCPathPoint_d (uint16_t k, int n)
float GetCPathPoint_v (uint16_t k, int n)
float GetCPathPoint_w (uint16_t k, int n)
void allocMemForVerticesData (int nVertices)
void setVertex_xy (uint16_t k, int n, int m, float x, float y)
float getVertex_x (uint16_t k, int n, int m)
float getVertex_y (uint16_t k, int n, int m)
float * getVertixesArray_x (uint16_t k, int n)
float * getVertixesArray_y (uint16_t k, int n)
unsigned int getVertixesCount ()
float getMax_V ()
float getMax_W ()
float getMax_V_inTPSpace ()
float index2alfa (uint16_t k)
 Alfa value for the discrete corresponding value.
uint16_t alfa2index (float alfa)
 Discrete index value for the corresponding alfa value.
void debugDumpInFiles (int nPT)
 Dump PTG trajectories in files in directory "./PTGs/".
bool SaveColGridsToFile (const std::string &filename)
bool LoadColGridsFromFile (const std::string &filename)
virtual void PTG_Generator (float alfa, float t, float x, float y, float phi, float &v, float &w)=0
 The main method to be implemented in derived classes.
virtual bool PTG_IsIntoDomain (float x, float y)=0
 To be implemented in derived classes:.

Static Public Member Functions

static
CParameterizedTrajectoryGenerator
CreatePTG (const TParameters< double > &params)
 The class factory for creating a PTG from a list of parameters "params".

Public Attributes

CColisionGrid m_collisionGrid
 The collision grid.
float refDistance

Protected Types

typedef std::vector< TCPointTCPointVector

Protected Member Functions

 CParameterizedTrajectoryGenerator (const TParameters< double > &params)
 Constructor: possible values in "params":
  • ref_distance: The maximum distance in PTGs
  • resolution: The cell size
  • v_max, w_max: Maximum robot speeds.

void initializeCollisionsGrid (float refDistance, float resolution)
 Initialized the collision grid with the given size and resolution.
void FreeMemory ()
 Free all the memory buffers:.

Protected Attributes

float V_MAX
float W_MAX
float TAU
float DELAY
float turningRadiusReference
CDynamicGrid
< TCellForLambdaFunction
m_lambdaFunctionOptimizer
 This grid will contain indexes data for speeding-up the default, brute-force lambda function.
float maxV_inTPSpace
bool flag1
bool flag2
unsigned int alfaValuesCount
 The number of discrete values for ALFA between -PI and +PI.
std::vector< TCPointVectorCPoints
std::vector< vector_floatvertexPoints_x
 The shape of the robot along the trajectories:.
std::vector< vector_floatvertexPoints_y
int nVertices


Detailed Description

This is the base class for any user defined PTG.

The class factory interface in CParameterizedTrajectoryGenerator::CreatePTG.

Changes history:

Definition at line 50 of file CParameterizedTrajectoryGenerator.h.


Member Typedef Documentation

A list of all the pairs (alpha,distance) such as the robot collides at that cell.

  • map key (uint16_t) -> alpha value (k)
    • map value (float) -> the MINIMUM distance (d), in meters, associated with that "k".

Definition at line 181 of file CParameterizedTrajectoryGenerator.h.

Definition at line 282 of file CParameterizedTrajectoryGenerator.h.


Constructor & Destructor Documentation

mrpt::reactivenav::CParameterizedTrajectoryGenerator::CParameterizedTrajectoryGenerator ( const TParameters< double > &  params  )  [protected]

Constructor: possible values in "params":

  • ref_distance: The maximum distance in PTGs
  • resolution: The cell size
  • v_max, w_max: Maximum robot speeds.

  • system_TAU, system_DELAY (Optional): Robot dynamics

virtual mrpt::reactivenav::CParameterizedTrajectoryGenerator::~CParameterizedTrajectoryGenerator (  )  [inline, virtual]

Destructor.

Definition at line 80 of file CParameterizedTrajectoryGenerator.h.


Member Function Documentation

uint16_t mrpt::reactivenav::CParameterizedTrajectoryGenerator::alfa2index ( float  alfa  )  [inline]

Discrete index value for the corresponding alfa value.

See also:
index2alfa

Definition at line 166 of file CParameterizedTrajectoryGenerator.h.

References M_2PI, and M_PI.

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::allocMemForVerticesData ( int  nVertices  ) 

static CParameterizedTrajectoryGenerator* mrpt::reactivenav::CParameterizedTrajectoryGenerator::CreatePTG ( const TParameters< double > &  params  )  [static]

The class factory for creating a PTG from a list of parameters "params".

Possible values in "params" are:

Exceptions:
std::logic_error On invalid or missing parameters.

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::debugDumpInFiles ( int  nPT  ) 

Dump PTG trajectories in files in directory "./PTGs/".

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::directionToMotionCommand ( uint16_t  k,
float &  out_v,
float &  out_w 
)

Converts an "alfa" value (into the discrete set) into a feasible motion command.

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::FreeMemory (  )  [protected]

Free all the memory buffers:.

size_t mrpt::reactivenav::CParameterizedTrajectoryGenerator::getAlfaValuesCount (  )  [inline]

Definition at line 102 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::GetCPathPoint_d ( uint16_t  k,
int  n 
) [inline]

Definition at line 111 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::GetCPathPoint_phi ( uint16_t  k,
int  n 
) [inline]

Definition at line 109 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::GetCPathPoint_t ( uint16_t  k,
int  n 
) [inline]

Definition at line 110 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::GetCPathPoint_v ( uint16_t  k,
int  n 
) [inline]

Definition at line 112 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::GetCPathPoint_w ( uint16_t  k,
int  n 
) [inline]

Definition at line 113 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::GetCPathPoint_x ( uint16_t  k,
int  n 
) [inline]

Definition at line 107 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::GetCPathPoint_y ( uint16_t  k,
int  n 
) [inline]

Definition at line 108 of file CParameterizedTrajectoryGenerator.h.

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::getCPointWhen_d_Is ( float  d,
uint16_t  k,
float &  x,
float &  y,
float &  phi,
float &  t,
float *  v = NULL,
float *  w = NULL 
)

virtual std::string mrpt::reactivenav::CParameterizedTrajectoryGenerator::getDescription (  )  [pure virtual]

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::getMax_V (  )  [inline]

Definition at line 151 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::getMax_V_inTPSpace (  )  [inline]

Definition at line 153 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::getMax_W (  )  [inline]

Definition at line 152 of file CParameterizedTrajectoryGenerator.h.

size_t mrpt::reactivenav::CParameterizedTrajectoryGenerator::getPointsCountInCPath_k ( uint16_t  k  )  [inline]

Definition at line 103 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::getVertex_x ( uint16_t  k,
int  n,
int  m 
) [inline]

Definition at line 123 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::getVertex_y ( uint16_t  k,
int  n,
int  m 
) [inline]

Definition at line 130 of file CParameterizedTrajectoryGenerator.h.

float* mrpt::reactivenav::CParameterizedTrajectoryGenerator::getVertixesArray_x ( uint16_t  k,
int  n 
) [inline]

Definition at line 137 of file CParameterizedTrajectoryGenerator.h.

float* mrpt::reactivenav::CParameterizedTrajectoryGenerator::getVertixesArray_y ( uint16_t  k,
int  n 
) [inline]

Definition at line 143 of file CParameterizedTrajectoryGenerator.h.

unsigned int mrpt::reactivenav::CParameterizedTrajectoryGenerator::getVertixesCount (  )  [inline]

Definition at line 149 of file CParameterizedTrajectoryGenerator.h.

float mrpt::reactivenav::CParameterizedTrajectoryGenerator::index2alfa ( uint16_t  k  )  [inline]

Alfa value for the discrete corresponding value.

See also:
alfa2index

Definition at line 158 of file CParameterizedTrajectoryGenerator.h.

References M_PI.

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::initializeCollisionsGrid ( float  refDistance,
float  resolution 
) [protected]

Initialized the collision grid with the given size and resolution.

virtual void mrpt::reactivenav::CParameterizedTrajectoryGenerator::lambdaFunction ( float  x,
float  y,
int &  out_k,
float &  out_d 
) [virtual]

The "lambda" function, see paper for info.

It takes the (a,d) pair that is closest to a given location.

Reimplemented in mrpt::reactivenav::CPTG1, mrpt::reactivenav::CPTG2, mrpt::reactivenav::CPTG3, mrpt::reactivenav::CPTG4, mrpt::reactivenav::CPTG5, mrpt::reactivenav::CPTG6, and mrpt::reactivenav::CPTG7.

bool mrpt::reactivenav::CParameterizedTrajectoryGenerator::LoadColGridsFromFile ( const std::string &  filename  ) 

virtual void mrpt::reactivenav::CParameterizedTrajectoryGenerator::PTG_Generator ( float  alfa,
float  t,
float  x,
float  y,
float  phi,
float &  v,
float &  w 
) [pure virtual]

virtual bool mrpt::reactivenav::CParameterizedTrajectoryGenerator::PTG_IsIntoDomain ( float  x,
float  y 
) [pure virtual]

bool mrpt::reactivenav::CParameterizedTrajectoryGenerator::SaveColGridsToFile ( const std::string &  filename  ) 

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::setVertex_xy ( uint16_t  k,
int  n,
int  m,
float  x,
float  y 
) [inline]

Definition at line 117 of file CParameterizedTrajectoryGenerator.h.

void mrpt::reactivenav::CParameterizedTrajectoryGenerator::simulateTrajectories ( uint16_t  alfaValuesCount,
float  max_time,
float  max_dist,
unsigned int  max_n,
float  diferencial_t,
float  min_dist,
float *  out_max_acc_v = NULL,
float *  out_max_acc_w = NULL 
)

The main method: solves the diferential equation to generate a family of parametrical trajectories.


Member Data Documentation

The number of discrete values for ALFA between -PI and +PI.

Definition at line 257 of file CParameterizedTrajectoryGenerator.h.

Definition at line 283 of file CParameterizedTrajectoryGenerator.h.

Definition at line 229 of file CParameterizedTrajectoryGenerator.h.

Definition at line 253 of file CParameterizedTrajectoryGenerator.h.

Definition at line 253 of file CParameterizedTrajectoryGenerator.h.

The collision grid.

Definition at line 209 of file CParameterizedTrajectoryGenerator.h.

This grid will contain indexes data for speeding-up the default, brute-force lambda function.

Definition at line 248 of file CParameterizedTrajectoryGenerator.h.

Definition at line 251 of file CParameterizedTrajectoryGenerator.h.

Definition at line 288 of file CParameterizedTrajectoryGenerator.h.

Definition at line 216 of file CParameterizedTrajectoryGenerator.h.

Definition at line 229 of file CParameterizedTrajectoryGenerator.h.

Definition at line 231 of file CParameterizedTrajectoryGenerator.h.

Definition at line 228 of file CParameterizedTrajectoryGenerator.h.

The shape of the robot along the trajectories:.

Definition at line 287 of file CParameterizedTrajectoryGenerator.h.

Definition at line 287 of file CParameterizedTrajectoryGenerator.h.

Definition at line 228 of file CParameterizedTrajectoryGenerator.h.




Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:27:43 EDT 2009