27 TCPoint(
const float x_,
const float y_,
const float phi_,
28 const float t_,
const float dist_,
29 const float v_,
const float w_) :
30 x(x_), y(y_), phi(phi_),
t(t_), dist(dist_), v(v_), w(w_)
32 float x,
y, phi,
t, dist,v,w;
48 virtual void ptgDiffDriveSteeringFunction(
float alpha,
float t,
float x,
float y,
float phi,
float &v,
float &w)
const = 0;
57 virtual bool inverseMap_WS2TP(
double x,
double y,
int &out_k,
double &out_d,
double tolerance_dist = 0.10)
const MRPT_OVERRIDE;
61 virtual mrpt::kinematics::CVehicleVelCmdPtr directionToMotionCommand( uint16_t k)
const MRPT_OVERRIDE;
62 virtual mrpt::kinematics::CVehicleVelCmdPtr getSupportedKinematicVelocityCommand()
const MRPT_OVERRIDE;
66 virtual void setRefDistance(
const double refDist)
MRPT_OVERRIDE;
71 double getPathDist(uint16_t k, uint32_t step)
const MRPT_OVERRIDE;
72 bool getPathStepForDist(uint16_t k,
double dist, uint32_t &out_step)
const MRPT_OVERRIDE;
77 void updateTPObstacle(
double ox,
double oy, std::vector<double> &tp_obstacles)
const MRPT_OVERRIDE;
78 void updateTPObstacleSingle(
double ox,
double oy, uint16_t k,
double &tp_obstacle_k)
const MRPT_OVERRIDE;
94 void internal_initialize(
const std::string & cacheFilename = std::string(),
const bool verbose =
true)
MRPT_OVERRIDE;
119 void simulateTrajectories(
125 float *out_max_acc_v = NULL,
126 float *out_max_acc_w = NULL);
142 :
mrpt::utils::CDynamicGrid<TCollisionCell>(x_min,x_max,y_min,y_max,resolution),
152 const TCollisionCell & getTPObstacle(
const float obsX,
const float obsY)
const;
159 void updateCellInfo(
const unsigned int icx,
const unsigned int icy,
const uint16_t k,
const float dist );
164 bool saveColGridsToFile(
const std::string &filename,
const mrpt::math::CPolygon & computed_robotShape )
const;
165 bool loadColGridsFromFile(
const std::string &filename,
const mrpt::math::CPolygon & current_robotShape );
175 k_min(
std::numeric_limits<uint16_t>::
max() ),
176 k_max(
std::numeric_limits<uint16_t>::
min() ),
177 n_min(
std::numeric_limits<uint32_t>::
max() ),
178 n_max(
std::numeric_limits<uint32_t>::
min() )
An internal class for storing the collision grid.
#define MRPT_DECLARE_TTYPENAME_NAMESPACE(_TYPE, __NS)
mrpt::utils::CStream NAV_IMPEXP & operator<<(mrpt::utils::CStream &o, const mrpt::nav::TCPoint &p)
Specifies the min/max values for "k" and "n", respectively.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Trajectory points in C-Space for non-holonomic robots.
double getMaxAngVel() const MRPT_OVERRIDE
Returns the maximum angular velocity expected from this PTG [rad/s].
mrpt::utils::CDynamicGrid< TCellForLambdaFunction > m_lambdaFunctionOptimizer
This grid will contain indexes data for speeding-up the default, brute-force lambda function...
double getMaxLinVel() const MRPT_OVERRIDE
Returns the maximum linear velocity expected from this PTG [m/s].
A wrapper of a TPolygon2D class, implementing CSerializable.
EIGEN_STRONG_INLINE const AdjointReturnType t() const
Transpose.
std::vector< TCPoint > TCPointVector
This class allows loading and storing values and vectors of different types from a configuration text...
TCPoint(const float x_, const float y_, const float phi_, const float t_, const float dist_, const float v_, const float w_)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
A 2D grid of dynamic size which stores any kind of data at each cell.
T max(const T v0, const T v1)
virtual void onNewNavDynamicState() MRPT_OVERRIDE
This family of PTGs ignores the dynamic states.
Base class for all PTGs using a 2D polygonal robot shape model.
double m_stepTimeDuration
T min(const T v0, const T v1)
std::vector< std::pair< uint16_t, float > > TCollisionCell
A list of all the pairs (alpha,distance) such as the robot collides at that cell. ...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CCollisionGrid m_collisionGrid
The collision grid.
virtual ~CCollisionGrid()
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)
::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CAbstractHolonomicReactiveMethodPtr &pObj)
Base class for all PTGs suitable to non-holonomic, differentially-driven (or Ackermann) vehicles base...
CCollisionGrid(float x_min, float x_max, float y_min, float y_max, float resolution, CPTG_DiffDrive_CollisionGridBased *parent)
double turningRadiusReference
std::vector< TCPointVector > m_trajectory
CPTG_DiffDrive_CollisionGridBased const * m_parent