MRSL Motion Primitive Library  1.2
A motion primitive library for generating trajectory for mobile robots
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrajSolver< Dim > Class Template Reference

Trajectory generator. More...

#include <traj_solver.h>

Public Member Functions

 TrajSolver (Control::Control control, Control::Control yaw_control=Control::VEL, bool debug=false)
 Constructor. More...
 
void setWaypoints (const vec_E< Waypoint< Dim >> &ws)
 Set Waypoint array directly, overwrite global vars.
 
void setV (decimal_t v)
 Set velocity used for internal time allocation.
 
void setDts (const std::vector< decimal_t > &dts)
 
void setPath (const vec_Vecf< Dim > &path)
 
Trajectory< Dim > solve (bool verbose=false)
 Solve for trajectory.
 
vec_Vecf< Dim > getPath () const
 Get the path used for time allocation.
 
vec_E< Waypoint< Dim > > getWaypoints () const
 Get the Waypoint array used to solve trajectory.
 
std::vector< decimal_tgetDts () const
 Get the time allocation.
 

Private Member Functions

std::vector< decimal_tallocate_time (const vec_Vecf< Dim > &pts, decimal_t v)
 Internal time allocation from path and vel using L-inf.
 

Private Attributes

vec_Vecf< Dim > path_
 Intermediate pos.
 
vec_E< Waypoint< Dim > > waypoints_
 Intermediate waypoints.
 
std::vector< decimal_tdts_
 Time allocation.
 
decimal_t v_ {1}
 Velocity used for internal time allocation.
 
Control::Control control_
 Control constraints for start and goal.
 
Control::Control yaw_control_
 Control constraints for start and goal yaw.
 
std::unique_ptr< PolySolver< Dim > > poly_solver_
 Poly solver.
 
std::unique_ptr< PolySolver< 1 > > yaw_solver_
 Poly solver for yaw only.
 

Detailed Description

template<int Dim>
class TrajSolver< Dim >

Trajectory generator.

Constructor & Destructor Documentation

◆ TrajSolver()

template<int Dim>
TrajSolver< Dim >::TrajSolver ( Control::Control  control,
Control::Control  yaw_control = Control::VEL,
bool  debug = false 
)
inline

Constructor.

Parameters
controldefine the control flag for start and end
yaw_controldefine the control flag for yaw start and end

Member Function Documentation

◆ setDts()

template<int Dim>
void TrajSolver< Dim >::setDts ( const std::vector< decimal_t > &  dts)
inline

Set time allocation (optional), overwrite global dts, if not set, we will set a time allocation using L-inf

◆ setPath()

template<int Dim>
void TrajSolver< Dim >::setPath ( const vec_Vecf< Dim > &  path)
inline

Set Waypoint array from path, overwrite global vars, in this mode, the intermediate Waypoint are with Control::VEL


The documentation for this class was generated from the following file: