MRSL Motion Primitive Library  1.2
A motion primitive library for generating trajectory for mobile robots
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
poly_traj.h
Go to the documentation of this file.
1 
5 #ifndef MPL_POLY_TRAJ_H
6 #define MPL_POLY_TRAJ_H
7 
8 #include <mpl_basis/primitive.h>
9 
10 #include <deque>
11 #include <memory>
12 
16 template <int Dim>
17 class PolyTraj {
18  public:
20  PolyTraj();
22  void clear();
24  void setWaypoints(const vec_E<Waypoint<Dim>>& ws);
26  void setTime(const std::vector<decimal_t>& dts);
28  void addCoeff(const MatDNf<Dim>& coeff);
34  decimal_t getTotalTime() const;
36  MatDNf<Dim> p();
37 
38  private:
39  std::vector<decimal_t> waypoint_times_;
40  std::vector<decimal_t> dts_;
41  vec_E<Waypoint<Dim>> waypoints_;
42  std::deque<MatDNf<Dim>, Eigen::aligned_allocator<MatDNf<Dim>>> coefficients_;
43 };
44 
47 
50 #endif
Primitive classes.
MatDNf< Dim > p()
Get the p.
Definition: poly_traj.cpp:91
vec_E< Primitive< Dim > > toPrimitives() const
Convert to Primitive class.
Definition: poly_traj.cpp:72
Waypoint base class.
Definition: waypoint.h:23
Eigen::Matrix< decimal_t, Eigen::Dynamic, N > MatDNf
MxN Eigen matrix with M unknown.
Definition: data_type.h:67
std::vector< T, Eigen::aligned_allocator< T > > vec_E
Pre-allocated std::vector for Eigen using vec_E.
Definition: data_type.h:53
void addCoeff(const MatDNf< Dim > &coeff)
Add coefficients.
Definition: poly_traj.cpp:54
void setWaypoints(const vec_E< Waypoint< Dim >> &ws)
Set waypoints.
Definition: poly_traj.cpp:59
Trajectory class for solving n-th polynomial with PolySolver.
Definition: poly_traj.h:17
PolyTraj< 2 > PolyTraj2D
PolyTraj in 2D.
Definition: poly_traj.h:46
Waypoint< Dim > evaluate(decimal_t t) const
Evaluate the waypoint at t.
Definition: poly_traj.cpp:7
PolyTraj< 3 > PolyTraj3D
PolyTraj in 3D.
Definition: poly_traj.h:49
decimal_t getTotalTime() const
Get the total time for the trajectory.
Definition: poly_traj.cpp:43
double decimal_t
Rename the float type used in lib.
Definition: data_type.h:49
void setTime(const std::vector< decimal_t > &dts)
Set time allocation.
Definition: poly_traj.cpp:64
PolyTraj()
Simple constructor.
Definition: poly_traj.cpp:4
void clear()
Clear.
Definition: poly_traj.cpp:48