rby1-sdk
Loading...
Searching...
No Matches
se3.h
1#pragma once
2
3#include <Eigen/Core>
4#include <optional>
5
6#include "so3.h"
7#include "rby1-sdk/export.h"
8
9namespace rb::math {
10
11class SE3;
12class se3;
13class se3v;
14
15class RBY1_SDK_API se3 {
16 public:
17 using MatrixType = Eigen::Matrix4d;
18
19 private:
20 se3() = default;
21};
22
23class RBY1_SDK_API se3v {
24 public:
25 using MatrixType = Eigen::Vector<double, 6>;
26
27 private:
28 se3v() = default;
29};
30
31class RBY1_SDK_API SE3 {
32 public:
33 using MatrixType = Eigen::Matrix4d;
34
35 static MatrixType Identity();
36
37 static MatrixType T(const Eigen::Vector3d& p);
38
39 static MatrixType T(const SO3::MatrixType& R, const Eigen::Vector3d& p = Eigen::Vector3d::Zero());
40
41 static MatrixType Inverse(const MatrixType& T);
42
43 static SO3::MatrixType GetRotation(const MatrixType& T);
44
45 static Eigen::Vector3d GetPosition(const MatrixType& T);
46
47 static MatrixType Exp(const se3v::MatrixType& S, double angle = 1.);
48
49 static MatrixType Exp(so3v::MatrixType w, Eigen::Vector3d v, double angle = 1.);
50
51 static se3v::MatrixType Log(const MatrixType& T);
52
53 static typename Eigen::Matrix<double, 6, 6> Ad(const MatrixType& T);
54
55 static se3v::MatrixType Ad(const MatrixType& T, const se3v::MatrixType& S);
56
57 static Eigen::Matrix<double, 6, 6> InvAd(const MatrixType& T);
58
59 static se3v::MatrixType InvAd(const MatrixType& T, const se3v::MatrixType& S);
60
61 static typename Eigen::Matrix<double, 6, 6> ad(const se3v::MatrixType& S);
62
63 static Eigen::Matrix<double, 6, 6> adTranspose(const se3v::MatrixType& S);
64
65 static se3v::MatrixType ad(const se3v::MatrixType& S1, const se3v::MatrixType& S2);
66
67 static se3v::MatrixType adTranspose(const se3v::MatrixType& S1, const se3v::MatrixType& S2);
68
69 static Eigen::Vector3d Multiply(const MatrixType& T, const Eigen::Vector3d& p);
70
71 template <typename Container, typename = std::enable_if_t<std::is_same_v<typename Container::value_type, MatrixType>>>
72 static std::optional<MatrixType> Average(const Container& matrices, double eps, int max_iter = -1);
73
74 static se3v::MatrixType Vec(const se3::MatrixType& s);
75
76 static se3::MatrixType Hat(const se3v::MatrixType& v);
77
78 private:
79 SE3() = default;
80};
81
82} // namespace rb::math
Definition se3.h:31
Definition se3.h:15
Definition se3.h:23
Definition log.h:12