MRSL Motion Primitive Library  1.2
A motion primitive library for generating trajectory for mobile robots
data_type.h
Go to the documentation of this file.
1 
8 #include <stdio.h>
9 
10 #include <Eigen/Geometry>
11 #include <Eigen/StdVector>
12 #include <vector>
13 
15 #ifndef ANSI_COLOR_RED
16 #define ANSI_COLOR_RED "\x1b[1;31m"
17 #endif
18 #ifndef ANSI_COLOR_GREEN
20 #define ANSI_COLOR_GREEN "\x1b[1;32m"
21 #endif
22 #ifndef ANSI_COLOR_YELLOW
24 #define ANSI_COLOR_YELLOW "\x1b[1;33m"
25 #endif
26 #ifndef ANSI_COLOR_BLUE
28 #define ANSI_COLOR_BLUE "\x1b[1;34m"
29 #endif
30 #ifndef ANSI_COLOR_MAGENTA
32 #define ANSI_COLOR_MAGENTA "\x1b[1;35m"
33 #endif
34 #ifndef ANSI_COLOR_CYAN
36 #define ANSI_COLOR_CYAN "\x1b[1;36m"
37 #endif
38 #ifndef ANSI_COLOR_RESET
40 #define ANSI_COLOR_RESET "\x1b[0m"
41 #endif
42 
43 #ifndef DATA_TYPE_H
44 #define DATA_TYPE_H
45 
49 typedef double decimal_t;
50 
52 template <typename T>
53 using vec_E = std::vector<T, Eigen::aligned_allocator<T>>;
55 template <int N>
56 using Vecf = Eigen::Matrix<decimal_t, N, 1>;
58 template <int N>
59 using Veci = Eigen::Matrix<int, N, 1>;
61 using VecDf = Eigen::Matrix<decimal_t, Eigen::Dynamic, 1>;
63 template <int M, int N>
64 using Matf = Eigen::Matrix<decimal_t, M, N>;
66 template <int N>
67 using MatDNf = Eigen::Matrix<decimal_t, Eigen::Dynamic, N>;
69 template <int N>
72 template <int N>
74 
76 typedef Vecf<2> Vec2f;
78 typedef Veci<2> Vec2i;
80 typedef Vecf<3> Vec3f;
82 typedef Veci<3> Vec3i;
84 typedef Vecf<4> Vec4f;
86 typedef Vecf<6> Vec6f;
87 
96 
98 typedef Matf<2, 2> Mat2f;
105 
112 
114 typedef Eigen::Transform<decimal_t, 2, Eigen::Affine> Aff2f;
116 typedef Eigen::Transform<decimal_t, 3, Eigen::Affine> Aff3f;
117 
118 #endif
Matf< Eigen::Dynamic, Eigen::Dynamic > MatDf
Dynamic MxN Eigen float matrix.
Definition: data_type.h:111
Matf< 3, 3 > Mat3f
3x3 Matrix in float
Definition: data_type.h:100
MatDNf< 3 > MatD3f
Mx3 Eigen float matrix.
Definition: data_type.h:109
Eigen::Matrix< decimal_t, Eigen::Dynamic, 1 > VecDf
Eigen 1D float vector of dynamic size.
Definition: data_type.h:61
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
Vecf< 3 > Vec3f
Eigen 1D float vector of size 3.
Definition: data_type.h:80
Matf< 2, 2 > Mat2f
2x2 Matrix in float
Definition: data_type.h:98
vec_E< Vecf< N > > vec_Vecf
Vector of Eigen 1D float vector.
Definition: data_type.h:70
Matf< 4, 4 > Mat4f
4x4 Matrix in float
Definition: data_type.h:102
Eigen::Matrix< decimal_t, M, N > Matf
MxN Eigen matrix.
Definition: data_type.h:64
Eigen::Matrix< int, N, 1 > Veci
Eigen 1D int vector of size N.
Definition: data_type.h:59
double decimal_t
Rename the float type used in lib.
Definition: data_type.h:49
Matf< 6, 6 > Mat6f
6x6 Matrix in float
Definition: data_type.h:104
Eigen::Transform< decimal_t, 3, Eigen::Affine > Aff3f
Allias of Eigen::Affine3d.
Definition: data_type.h:116
Vecf< 2 > Vec2f
Eigen 1D float vector of size 2.
Definition: data_type.h:76
vec_E< Veci< N > > vec_Veci
Vector of Eigen 1D int vector.
Definition: data_type.h:73
Vecf< 6 > Vec6f
Column vector in float of size 6.
Definition: data_type.h:86
vec_E< Vec3i > vec_Vec3i
Vector of type Vec3i.
Definition: data_type.h:95
Eigen::Matrix< decimal_t, N, 1 > Vecf
Eigen 1D float vector of size N.
Definition: data_type.h:56
Vecf< 4 > Vec4f
Eigen 1D float vector of size 4.
Definition: data_type.h:84
vec_E< Vec3f > vec_Vec3f
Vector of type Vec3f.
Definition: data_type.h:93
vec_E< Vec2i > vec_Vec2i
Vector of type Vec2i.
Definition: data_type.h:91
Veci< 3 > Vec3i
Eigen 1D int vector of size 3.
Definition: data_type.h:82
Eigen::Transform< decimal_t, 2, Eigen::Affine > Aff2f
Allias of Eigen::Affine2d.
Definition: data_type.h:114
Veci< 2 > Vec2i
Eigen 1D int vector of size 2.
Definition: data_type.h:78
vec_E< Vec2f > vec_Vec2f
Vector of type Vec2f.
Definition: data_type.h:89