MSCEqF 1.0
Multi State Constraint Equivariant Filter for visual inertial navigation
Loading...
Searching...
No Matches
sensor_data.hpp
1// Copyright (C) 2023 Alessandro Fornasier.
2// Control of Networked Systems, University of Klagenfurt, Austria.
3//
4// All rights reserved.
5//
6// This software is licensed under the terms of the BSD-2-Clause-License with
7// no commercial use allowed, the full terms of which are made available
8// in the LICENSE file. No license in patents is granted.
9//
10// You can contact the authors at <alessandro.fornasier@ieee.org>
11
12#ifndef INPUT_HPP
13#define INPUT_HPP
14
15#include <opencv2/opencv.hpp>
16
17#include "types/fptypes.hpp"
18#include "vision/features.hpp"
19
20namespace msceqf
21{
28struct Imu
29{
35 const Vector6 w() const { return (Vector6() << ang_, acc_).finished(); }
36
42 const Matrix5 W() const
43 {
44 Matrix5 W = Matrix5::Zero();
45 W.block<3, 3>(0, 0) = SO3::wedge(ang_);
46 W.block<3, 1>(0, 3) = acc_;
47 return W;
48 }
49
54 friend bool operator<(const Imu& lhs, const Imu& rhs) { return lhs.timestamp_ < rhs.timestamp_; }
55
60 friend bool operator<(const Imu& lhs, const fp& timestamp) { return lhs.timestamp_ < timestamp; }
61 friend bool operator<(const fp& timestamp, const Imu& rhs) { return timestamp < rhs.timestamp_; }
62
67 friend std::ostream& operator<<(std::ostream& stream, Imu const& imu)
68 {
69 return stream << "(" << imu.timestamp_ << ", " << imu.ang_.transpose() << ", " << imu.acc_.transpose() << ")";
70 }
71
72 Vector3 ang_ = Vector3::Zero();
73 Vector3 acc_ = Vector3::Zero();
74 fp timestamp_ = -1;
75};
76
77struct Camera
78{
83 friend bool operator<(const Camera& lhs, const Camera& rhs) { return lhs.timestamp_ < rhs.timestamp_; }
84
89 friend bool operator<(const Camera& lhs, const fp& timestamp) { return lhs.timestamp_ < timestamp; }
90 friend bool operator<(const fp& timestamp, const Camera& rhs) { return timestamp < rhs.timestamp_; }
91
92 cv::Mat image_;
93 cv::Mat mask_;
94 fp timestamp_ = -1;
95};
96
98{
103 friend bool operator<(const TriangulatedFeatures& lhs, const TriangulatedFeatures& rhs)
104 {
105 return lhs.timestamp_ < rhs.timestamp_;
106 }
107
112 friend bool operator<(const TriangulatedFeatures& lhs, const fp& timestamp) { return lhs.timestamp_ < timestamp; }
113 friend bool operator<(const fp& timestamp, const TriangulatedFeatures& rhs) { return timestamp < rhs.timestamp_; }
114
116 std::vector<Vector3> points_;
117 fp timestamp_ = -1;
118};
119
120} // namespace msceqf
121
122#endif // INPUT_HPP
Definition sensor_data.hpp:78
cv::Mat mask_
The mask for the given image, 255 in valid reagions, 0 in regions to be masked out.
Definition sensor_data.hpp:93
fp timestamp_
Timestamp of the Camera reading.
Definition sensor_data.hpp:94
cv::Mat image_
The image taken from the camera.
Definition sensor_data.hpp:92
friend bool operator<(const Camera &lhs, const Camera &rhs)
Comparison operator with other camera.
Definition sensor_data.hpp:83
friend bool operator<(const Camera &lhs, const fp &timestamp)
Comparison operator with timestamp.
Definition sensor_data.hpp:89
(Cache friendly) Features struct. Define a set of features detected/tracked.
Definition features.hpp:30
Struct for one IMU reading. It includes timestamp, angular velocity and linear acceleration....
Definition sensor_data.hpp:29
fp timestamp_
Timestamp of the IMU reading.
Definition sensor_data.hpp:74
Vector3 acc_
Acceleration vector.
Definition sensor_data.hpp:73
friend bool operator<(const Imu &lhs, const Imu &rhs)
Comparison operator with other imu.
Definition sensor_data.hpp:54
friend bool operator<(const Imu &lhs, const fp &timestamp)
Comparison operator with timestamp.
Definition sensor_data.hpp:60
const Vector6 w() const
Get the IMU measurement as a 6 vector (ang, acc)
Definition sensor_data.hpp:35
const Matrix5 W() const
get the IMU measurement as an extended matrix (ang, acc, 0)^ (SE23 lie algebra element)
Definition sensor_data.hpp:42
Vector3 ang_
Angular velocity vector.
Definition sensor_data.hpp:72
friend std::ostream & operator<<(std::ostream &stream, Imu const &imu)
Stream an Imu.
Definition sensor_data.hpp:67
Definition sensor_data.hpp:98
friend bool operator<(const TriangulatedFeatures &lhs, const fp &timestamp)
Comparison operator with timestamp.
Definition sensor_data.hpp:112
fp timestamp_
Timestamp of the Camera reading.
Definition sensor_data.hpp:117
std::vector< Vector3 > points_
The 3D points corresponding to the features.
Definition sensor_data.hpp:116
Features features_
The features detected in the image.
Definition sensor_data.hpp:115
friend bool operator<(const TriangulatedFeatures &lhs, const TriangulatedFeatures &rhs)
Comparison operator with other imu.
Definition sensor_data.hpp:103