MRSL Motion Primitive Library  1.2
A motion primitive library for generating trajectory for mobile robots
poly_solver.h
Go to the documentation of this file.
1 
5 #ifndef MPL_POLY_SOLVER_H
6 #define MPL_POLY_SOLVER_H
7 
9 
10 #include <Eigen/Core>
11 #include <Eigen/LU>
12 #include <Eigen/StdVector>
13 
20 template <int Dim>
21 class PolySolver {
22  public:
28  PolySolver(unsigned int smooth_derivative_order,
29  unsigned int minimize_derivative, bool debug = false);
37  bool solve(const vec_E<Waypoint<Dim>>& waypoints,
38  const std::vector<decimal_t>& dts);
39 
41  std::shared_ptr<PolyTraj<Dim>> getTrajectory();
42 
43  protected:
45  unsigned int N_;
47  unsigned int R_;
48  MatDf A_;
49  MatDf Q_;
51  bool debug_;
53  std::shared_ptr<PolyTraj<Dim>> ptraj_;
54 };
55 
58 
61 #endif
Matf< Eigen::Dynamic, Eigen::Dynamic > MatDf
Dynamic MxN Eigen float matrix.
Definition: data_type.h:111
Waypoint base class.
Definition: waypoint.h:23
PolySolver< 2 > PolySolver2D
PolySolver for 2D.
Definition: poly_solver.h:57
std::shared_ptr< PolyTraj< Dim > > ptraj_
Solved trajectory.
Definition: poly_solver.h:53
PolySolver< 3 > PolySolver3D
PolySolver for 3D.
Definition: poly_solver.h:60
std::vector< T, Eigen::aligned_allocator< T > > vec_E
Pre-allocated std::vector for Eigen using vec_E.
Definition: data_type.h:53
bool solve(const vec_E< Waypoint< Dim >> &waypoints, const std::vector< decimal_t > &dts)
Solve the trajector as defined in constructor.
Definition: poly_solver.cpp:23
Trajectory object for PolySolver.
unsigned int N_
Number of coefficients of a polynomial.
Definition: poly_solver.h:45
PolySolver(unsigned int smooth_derivative_order, unsigned int minimize_derivative, bool debug=false)
Simple constructor.
Definition: poly_solver.cpp:4
unsigned int R_
Order of derivative to optimize.
Definition: poly_solver.h:47
bool debug_
Enble output on screen.
Definition: poly_solver.h:51
std::shared_ptr< PolyTraj< Dim > > getTrajectory()
Get the solved trajectory.
Definition: poly_solver.cpp:18
Trajectory generator back-end class.
Definition: poly_solver.h:21