SystemModel.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 * @package ROBDEKON
17 * @author Christoph Pohl ( christoph dot pohl at kit dot edu )
18 * @date 18.03.21
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 *
22 * Code adapted to C++ from: https://github.com/CAOR-MINES-ParisTech/ukfm
23 * See also:
24 * - https://arxiv.org/pdf/2002.00878.pdf
25 * - https://ieeexplore.ieee.org/document/8206066/
26 */
27
28
29#ifndef ROBDEKON_SYSTEMMODEL_H
30#define ROBDEKON_SYSTEMMODEL_H
31
32#include <Eigen/Dense>
33
34#define MANIF_NO_DEBUG
35#include <manif/SE3.h>
36#include <manif/SO3.h>
37
38template <typename floatT>
40{
41 manif::SE3<floatT> pose;
42};
43
44template <typename floatT>
46{
47 typename manif::SE3<floatT>::Tangent velocity;
48};
49
50template <typename floatT>
52{
53 manif::SE3<floatT> pose;
54 typename manif::SE3<floatT>::Tangent velocity;
55};
56
57template <typename floatT>
63
64template <typename floatT>
66{
67 typename manif::SO3<floatT>::Tangent angular_velocity;
69};
70
71template <typename floatT>
76
77template <typename floatT>
79{
80 static_assert(std::is_floating_point_v<floatT>);
81
82 struct dim
83 {
84 static constexpr long state = 6, control = 6, obs = 6;
85 };
86
87 using FloatT = floatT;
92 Eigen::Matrix<FloatT, dim::control, 1>; // todo: correct name? Is it the same as ControlT?
94
95 static ObsT observationFunction(const StateT& state);
96
97 static StateT propagationFunction(const StateT& state,
98 const ControlT& control,
99 const ControlNoiseT& noise,
100 FloatT dt);
101
102 static StateT retraction(const StateT& state, const SigmaPointsT& sigmaPoints);
103
104 static SigmaPointsT inverseRetraction(const StateT& state1, const StateT& state2);
105};
106
107template <typename floatT>
109{
110 static_assert(std::is_floating_point_v<floatT>);
111
112 struct dim
113 {
114 static constexpr long state = 6, control = 6, obs = 6;
115 };
116
117 using FloatT = floatT;
122 Eigen::Matrix<FloatT, dim::control, 1>; // todo: correct name? Is it the same as ControlT?
124
125 static ObsT observationFunction(const StateT& state);
126
127 static StateT propagationFunction(const StateT& state,
128 const ControlT& control,
129 const ControlNoiseT& noise,
130 FloatT dt);
131
132 static StateT retraction(const StateT& state, const SigmaPointsT& sigmaPoints);
133
134 static SigmaPointsT inverseRetraction(const StateT& state1, const StateT& state2);
135};
136
137template <typename floatT>
139{
140 static_assert(std::is_floating_point_v<floatT>);
141
142 struct dim
143 {
144 static constexpr long state = 12, control = 6, obs = 6;
145 };
146
147 using FloatT = floatT;
152 Eigen::Matrix<FloatT, dim::control, 1>; // todo: correct name? Is it the same as ControlT?
154
155 static ObsT observationFunction(const StateT& state);
156
157 static StateT propagationFunction(const StateT& state,
158 const ControlT& control,
159 const ControlNoiseT& noise,
160 FloatT dt);
161
162 static StateT retraction(const StateT& state, const SigmaPointsT& sigmaPoints);
163
164 static SigmaPointsT inverseRetraction(const StateT& state1, const StateT& state2);
165};
166
167extern template struct SystemModelSE3<float>;
168extern template struct SystemModelSE3<double>;
169extern template struct SystemModelSO3xR3<float>;
170extern template struct SystemModelSO3xR3<double>;
171extern template struct SystemModelSE3xV<float>;
172extern template struct SystemModelSE3xV<double>;
173#endif //ROBDEKON_SYSTEMMODEL_H
constexpr T dt
This file is part of ArmarX.
manif::SE3< FloatT >::Tangent velocity
Definition SystemModel.h:47
Eigen::Matrix< FloatT, 6, 1 > acceleration
Definition SystemModel.h:74
manif::SO3< FloatT >::Tangent angular_velocity
Definition SystemModel.h:67
Eigen::Matrix< FloatT, 3, 1 > euclidean_velocity
Definition SystemModel.h:68
manif::SE3< FloatT > pose
Definition SystemModel.h:41
manif::SE3< FloatT >::Tangent velocity
Definition SystemModel.h:54
manif::SE3< FloatT > pose
Definition SystemModel.h:53
manif::SO3< FloatT > orientation
Definition SystemModel.h:60
Eigen::Matrix< FloatT, 3, 1 > position
Definition SystemModel.h:61
static constexpr long state
Definition SystemModel.h:84
static constexpr long obs
Definition SystemModel.h:84
ControlSE3< FloatT > ControlT
Definition SystemModel.h:89
StateSE3< FloatT > StateT
Definition SystemModel.h:88
static ObsT observationFunction(const StateT &state)
static StateT retraction(const StateT &state, const SigmaPointsT &sigmaPoints)
Eigen::Matrix< FloatT, dim::state, 1 > SigmaPointsT
Definition SystemModel.h:93
Eigen::Matrix< FloatT, dim::control, 1 > ControlNoiseT
Definition SystemModel.h:91
static StateT propagationFunction(const StateT &state, const ControlT &control, const ControlNoiseT &noise, FloatT dt)
Eigen::Matrix< FloatT, dim::obs, 1 > ObsT
Definition SystemModel.h:90
static SigmaPointsT inverseRetraction(const StateT &state1, const StateT &state2)
static constexpr long state
static constexpr long obs
ControlSE3xV< FloatT > ControlT
static SigmaPointsT inverseRetraction(const StateT &state1, const StateT &state2)
static ObsT observationFunction(const StateT &state)
Eigen::Matrix< FloatT, dim::state, 1 > SigmaPointsT
Eigen::Matrix< FloatT, dim::control, 1 > ControlNoiseT
StateSE3xV< FloatT > StateT
Eigen::Matrix< FloatT, dim::obs, 1 > ObsT
static StateT retraction(const StateT &state, const SigmaPointsT &sigmaPoints)
static StateT propagationFunction(const StateT &state, const ControlT &control, const ControlNoiseT &noise, FloatT dt)
static constexpr long state
static constexpr long obs
static ObsT observationFunction(const StateT &state)
static StateT retraction(const StateT &state, const SigmaPointsT &sigmaPoints)
StateSO3xR3< FloatT > StateT
static StateT propagationFunction(const StateT &state, const ControlT &control, const ControlNoiseT &noise, FloatT dt)
ControlSO3xR3< FloatT > ControlT
Eigen::Matrix< FloatT, dim::state, 1 > SigmaPointsT
Eigen::Matrix< FloatT, dim::control, 1 > ControlNoiseT
Eigen::Matrix< FloatT, dim::obs, 1 > ObsT
static SigmaPointsT inverseRetraction(const StateT &state1, const StateT &state2)