HumanSystemModel.h
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Tobias Gröger ( tobias dot groeger at student dot kit dot edu )
17 * @author Corvin Navarro Ecker ( corvin dot ecker at student dot kit dot edu )
18 * @date 2022
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22#pragma once
23
24#include <manif/SE2.h> // IWYU pragma: keep
25#include <manif/SO2.h> // IWYU pragma: keep
26
28{
29 //----------- SO2xR2 -----------------
30
31 template <typename floatT>
33 {
34 manif::SO2<floatT> orientation;
36 };
37
38 template <typename floatT>
40 {
41 typename manif::SO2<floatT>::Tangent angular_velocity;
43 };
44
45 template <typename floatT>
47 {
48 static_assert(std::is_floating_point_v<floatT>);
49
50 struct dim
51 {
52 static constexpr long state = 3, control = 3, obs = 3;
53 };
54
55 using FloatT = floatT;
59 using ControlNoiseT = Eigen::
60 Matrix<FloatT, dim::control, 1>; // todo: correct name? Is it the same as ControlT?
62
63 static ObsT observationFunction(const StateT& state);
64
65 static StateT propagationFunction(const StateT& state,
66 const ControlT& control,
67 const ControlNoiseT& noise,
68 FloatT dt);
69
70 static StateT retraction(const StateT& state, const SigmaPointsT& sigmaPoints);
71
72 static SigmaPointsT inverseRetraction(const StateT& state1, const StateT& state2);
73 };
74
75 extern template struct SystemModelSO2xR2<float>;
76 extern template struct SystemModelSO2xR2<double>;
77
78 //----------- SE2 -----------------
79
80 template <typename floatT>
81 struct StateSE2
82 {
83 manif::SE2<floatT> pose;
84 };
85
86 template <typename floatT>
88 {
89 typename manif::SE2<floatT>::Tangent velocity;
90 };
91
92 template <typename floatT>
94 {
95 static_assert(std::is_floating_point_v<floatT>);
96
97 struct dim
98 {
99 static constexpr long state = 3, control = 3, obs = 3;
100 };
101
102 using FloatT = floatT;
106 using ControlNoiseT = Eigen::
107 Matrix<FloatT, dim::control, 1>; // todo: correct name? Is it the same as ControlT?
109
110 static ObsT observationFunction(const StateT& state);
111
112 static StateT propagationFunction(const StateT& state,
113 const ControlT& control,
114 const ControlNoiseT& noise,
115 FloatT dt);
116
117 static StateT retraction(const StateT& state, const SigmaPointsT& sigmaPoints);
118
119 static SigmaPointsT inverseRetraction(const StateT& state1, const StateT& state2);
120 };
121
122 extern template struct SystemModelSE2<float>;
123 extern template struct SystemModelSE2<double>;
124
125 //----------- SE2xV -----------------
126
127 template <typename floatT>
129 {
130 manif::SE2<floatT> pose;
131 typename manif::SE2<floatT>::Tangent velocity;
132 };
133
134 template <typename floatT>
136 {
137 };
138
139 template <typename floatT>
141 {
142 static_assert(std::is_floating_point_v<floatT>);
143
144 struct dim
145 {
146 static constexpr long state = 6, control = 1, obs = 3;
147 };
148
149 using FloatT = floatT;
153 using ControlNoiseT = Eigen::
154 Matrix<FloatT, dim::control, 1>; // todo: correct name? Is it the same as ControlT?
156
157 static ObsT observationFunction(const StateT& state);
158
159 static StateT propagationFunction(const StateT& state,
160 const ControlT& control,
161 const ControlNoiseT& noise,
162 FloatT dt);
163
164 static StateT retraction(const StateT& state, const SigmaPointsT& sigmaPoints);
165
166 static SigmaPointsT inverseRetraction(const StateT& state1, const StateT& state2);
167 };
168
169 extern template struct SystemModelSE2xV<float>;
170 extern template struct SystemModelSE2xV<double>;
171
172} // namespace armarx::navigation::human::kalman_filter
constexpr T dt
This file is part of ArmarX.
static SigmaPointsT inverseRetraction(const StateT &state1, const StateT &state2)
static StateT retraction(const StateT &state, const SigmaPointsT &sigmaPoints)
static StateT propagationFunction(const StateT &state, const ControlT &control, const ControlNoiseT &noise, FloatT dt)
static SigmaPointsT inverseRetraction(const StateT &state1, const StateT &state2)
static StateT retraction(const StateT &state, const SigmaPointsT &sigmaPoints)
static StateT propagationFunction(const StateT &state, const ControlT &control, const ControlNoiseT &noise, FloatT dt)
Eigen:: Matrix< FloatT, dim::control, 1 > ControlNoiseT
static SigmaPointsT inverseRetraction(const StateT &state1, const StateT &state2)
static StateT propagationFunction(const StateT &state, const ControlT &control, const ControlNoiseT &noise, FloatT dt)
static StateT retraction(const StateT &state, const SigmaPointsT &sigmaPoints)
Eigen:: Matrix< FloatT, dim::control, 1 > ControlNoiseT