rm_control
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eigen_types.h
Go to the documentation of this file.
1/*******************************************************************************
2 * BSD 3-Clause License
3 *
4 * Copyright (c) 2021, Qiayuan Liao
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * * Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 * * Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE
25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *******************************************************************************/
33
34//
35// Created by qiayuan on 4/3/20.
36//
37
38#pragma once
39
40#include <eigen3/Eigen/Dense>
41
42#include <vector>
43
44// Rotation Matrix
45template <typename T>
46using RotMat = typename Eigen::Matrix<T, 3, 3>;
47
48// 2x1 Vector
49template <typename T>
50using Vec2 = typename Eigen::Matrix<T, 2, 1>;
51
52// 3x1 Vector
53template <typename T>
54using Vec3 = typename Eigen::Matrix<T, 3, 1>;
55
56// 4x1 Vector
57template <typename T>
58using Vec4 = typename Eigen::Matrix<T, 4, 1>;
59
60// 6x1 Vector
61template <typename T>
62using Vec6 = Eigen::Matrix<T, 6, 1>;
63
64// 8x1 Vector
65template <typename T>
66using Vec8 = Eigen::Matrix<T, 8, 1>;
67
68// 10x1 Vector
69template <typename T>
70using Vec10 = Eigen::Matrix<T, 10, 1>;
71
72// 12x1 Vector
73template <typename T>
74using Vec12 = Eigen::Matrix<T, 12, 1>;
75
76// 18x1 Vector
77template <typename T>
78using Vec18 = Eigen::Matrix<T, 18, 1>;
79
80// 28x1 vector
81template <typename T>
82using Vec28 = Eigen::Matrix<T, 28, 1>;
83
84// 2x2 Matrix
85template <typename T>
86using Mat2 = typename Eigen::Matrix<T, 2, 2>;
87
88// 3x3 Matrix
89template <typename T>
90using Mat3 = typename Eigen::Matrix<T, 3, 3>;
91
92// 8x8 Matrix
93template <typename T>
94using Mat8 = typename Eigen::Matrix<T, 8, 8>;
95
96// 4x1 Vector
97template <typename T>
98using Quat = typename Eigen::Matrix<T, 4, 1>;
99
100// Spatial Vector (6x1, all subspaces)
101template <typename T>
102using SVec = typename Eigen::Matrix<T, 6, 1>;
103
104// Spatial Transform (6x6)
105template <typename T>
106using SXform = typename Eigen::Matrix<T, 6, 6>;
107
108// 6x6 Matrix
109template <typename T>
110using Mat6 = typename Eigen::Matrix<T, 6, 6>;
111
112// 12x12 Matrix
113template <typename T>
114using Mat12 = typename Eigen::Matrix<T, 12, 12>;
115
116// 18x18 Matrix
117template <typename T>
118using Mat18 = Eigen::Matrix<T, 18, 18>;
119
120// 28x28 Matrix
121template <typename T>
122using Mat28 = Eigen::Matrix<T, 28, 28>;
123
124// 3x4 Matrix
125template <typename T>
126using Mat34 = Eigen::Matrix<T, 3, 4>;
127
128// 3x4 Matrix
129template <typename T>
130using Mat23 = Eigen::Matrix<T, 2, 3>;
131
132// 4x4 Matrix
133template <typename T>
134using Mat4 = typename Eigen::Matrix<T, 4, 4>;
135
136// 10x1 Vector
137template <typename T>
138using MassProperties = typename Eigen::Matrix<T, 10, 1>;
139
140// Dynamically sized vector
141template <typename T>
142using DVec = typename Eigen::Matrix<T, Eigen::Dynamic, 1>;
143
144// Dynamically sized matrix
145template <typename T>
146using DMat = typename Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
147
148// Dynamically sized matrix with spatial vector columns
149template <typename T>
150using D6Mat = typename Eigen::Matrix<T, 6, Eigen::Dynamic>;
151
152// Dynamically sized matrix with cartesian vector columns
153template <typename T>
154using D3Mat = typename Eigen::Matrix<T, 3, Eigen::Dynamic>;
155
156// std::vector (a list) of Eigen things
157template <typename T>
158using vectorAligned = typename std::vector<T, Eigen::aligned_allocator<T>>;
typename Eigen::Matrix< T, 6, Eigen::Dynamic > D6Mat
Definition eigen_types.h:150
typename std::vector< T, Eigen::aligned_allocator< T > > vectorAligned
Definition eigen_types.h:158
typename Eigen::Matrix< T, 3, 3 > RotMat
Definition eigen_types.h:46
typename Eigen::Matrix< T, 3, Eigen::Dynamic > D3Mat
Definition eigen_types.h:154
typename Eigen::Matrix< T, 6, 6 > SXform
Definition eigen_types.h:106
Eigen::Matrix< T, 6, 1 > Vec6
Definition eigen_types.h:62
Eigen::Matrix< T, 18, 1 > Vec18
Definition eigen_types.h:78
typename Eigen::Matrix< T, 6, 1 > SVec
Definition eigen_types.h:102
typename Eigen::Matrix< T, 2, 1 > Vec2
Definition eigen_types.h:50
Eigen::Matrix< T, 8, 1 > Vec8
Definition eigen_types.h:66
Eigen::Matrix< T, 28, 28 > Mat28
Definition eigen_types.h:122
Eigen::Matrix< T, 10, 1 > Vec10
Definition eigen_types.h:70
typename Eigen::Matrix< T, 4, 4 > Mat4
Definition eigen_types.h:134
Eigen::Matrix< T, 2, 3 > Mat23
Definition eigen_types.h:130
typename Eigen::Matrix< T, 3, 1 > Vec3
Definition eigen_types.h:54
typename Eigen::Matrix< T, 4, 1 > Vec4
Definition eigen_types.h:58
Eigen::Matrix< T, 28, 1 > Vec28
Definition eigen_types.h:82
typename Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > DMat
Definition eigen_types.h:146
typename Eigen::Matrix< T, 8, 8 > Mat8
Definition eigen_types.h:94
typename Eigen::Matrix< T, 4, 1 > Quat
Definition eigen_types.h:98
Eigen::Matrix< T, 12, 1 > Vec12
Definition eigen_types.h:74
Eigen::Matrix< T, 3, 4 > Mat34
Definition eigen_types.h:126
typename Eigen::Matrix< T, 3, 3 > Mat3
Definition eigen_types.h:90
Eigen::Matrix< T, 18, 18 > Mat18
Definition eigen_types.h:118
typename Eigen::Matrix< T, 2, 2 > Mat2
Definition eigen_types.h:86
typename Eigen::Matrix< T, 10, 1 > MassProperties
Definition eigen_types.h:138
typename Eigen::Matrix< T, 12, 12 > Mat12
Definition eigen_types.h:114
typename Eigen::Matrix< T, Eigen::Dynamic, 1 > DVec
Definition eigen_types.h:142
typename Eigen::Matrix< T, 6, 6 > Mat6
Definition eigen_types.h:110