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 Apache License, Version 2.0
7// (the "License"); you may not use this file except in compliance with the
8// License. You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15// License for the specific language governing permissions and limitations
16// under the License.
17//
18// You can contact the authors at <alessandro.fornasier@ieee.org>
19
20#ifndef INPUT_HPP
21#define INPUT_HPP
22
23#include <opencv2/opencv.hpp>
24
25#include "types/fptypes.hpp"
26#include "vision/features.hpp"
27
28namespace msceqf
29{
36struct Imu
37{
43 const Vector6 w() const { return (Vector6() << ang_, acc_).finished(); }
44
50 const Matrix5 W() const
51 {
52 Matrix5 W = Matrix5::Zero();
53 W.block<3, 3>(0, 0) = SO3::wedge(ang_);
54 W.block<3, 1>(0, 3) = acc_;
55 return W;
56 }
57
62 friend bool operator<(const Imu& lhs, const Imu& rhs) { return lhs.timestamp_ < rhs.timestamp_; }
63
68 friend bool operator<(const Imu& lhs, const fp& timestamp) { return lhs.timestamp_ < timestamp; }
69 friend bool operator<(const fp& timestamp, const Imu& rhs) { return timestamp < rhs.timestamp_; }
70
75 friend std::ostream& operator<<(std::ostream& stream, Imu const& imu)
76 {
77 return stream << "(" << imu.timestamp_ << ", " << imu.ang_.transpose() << ", " << imu.acc_.transpose() << ")";
78 }
79
80 Vector3 ang_ = Vector3::Zero();
81 Vector3 acc_ = Vector3::Zero();
82 fp timestamp_ = -1;
83};
84
85struct Camera
86{
91 friend bool operator<(const Camera& lhs, const Camera& rhs) { return lhs.timestamp_ < rhs.timestamp_; }
92
97 friend bool operator<(const Camera& lhs, const fp& timestamp) { return lhs.timestamp_ < timestamp; }
98 friend bool operator<(const fp& timestamp, const Camera& rhs) { return timestamp < rhs.timestamp_; }
99
100 cv::Mat image_;
101 cv::Mat mask_;
102 fp timestamp_ = -1;
103};
104
106{
111 friend bool operator<(const TriangulatedFeatures& lhs, const TriangulatedFeatures& rhs)
112 {
113 return lhs.timestamp_ < rhs.timestamp_;
114 }
115
120 friend bool operator<(const TriangulatedFeatures& lhs, const fp& timestamp) { return lhs.timestamp_ < timestamp; }
121 friend bool operator<(const fp& timestamp, const TriangulatedFeatures& rhs) { return timestamp < rhs.timestamp_; }
122
124 std::vector<Vector3> points_;
125 fp timestamp_ = -1;
126};
127
128} // namespace msceqf
129
130#endif // INPUT_HPP
Definition sensor_data.hpp:86
cv::Mat mask_
The mask for the given image, 255 in valid reagions, 0 in regions to be masked out.
Definition sensor_data.hpp:101
fp timestamp_
Timestamp of the Camera reading.
Definition sensor_data.hpp:102
cv::Mat image_
The image taken from the camera.
Definition sensor_data.hpp:100
friend bool operator<(const Camera &lhs, const Camera &rhs)
Comparison operator with other camera.
Definition sensor_data.hpp:91
friend bool operator<(const Camera &lhs, const fp &timestamp)
Comparison operator with timestamp.
Definition sensor_data.hpp:97
(Cache friendly) Features struct. Define a set of features detected/tracked.
Definition features.hpp:38
Struct for one IMU reading. It includes timestamp, angular velocity and linear acceleration....
Definition sensor_data.hpp:37
fp timestamp_
Timestamp of the IMU reading.
Definition sensor_data.hpp:82
Vector3 acc_
Acceleration vector.
Definition sensor_data.hpp:81
friend bool operator<(const Imu &lhs, const Imu &rhs)
Comparison operator with other imu.
Definition sensor_data.hpp:62
friend bool operator<(const Imu &lhs, const fp &timestamp)
Comparison operator with timestamp.
Definition sensor_data.hpp:68
const Vector6 w() const
Get the IMU measurement as a 6 vector (ang, acc).
Definition sensor_data.hpp:43
const Matrix5 W() const
get the IMU measurement as an extended matrix (ang, acc, 0)^ (SE23 lie algebra element)
Definition sensor_data.hpp:50
Vector3 ang_
Angular velocity vector.
Definition sensor_data.hpp:80
friend std::ostream & operator<<(std::ostream &stream, Imu const &imu)
Stream an Imu.
Definition sensor_data.hpp:75
Definition sensor_data.hpp:106
friend bool operator<(const TriangulatedFeatures &lhs, const fp &timestamp)
Comparison operator with timestamp.
Definition sensor_data.hpp:120
fp timestamp_
Timestamp of the Camera reading.
Definition sensor_data.hpp:125
std::vector< Vector3 > points_
The 3D points corresponding to the features.
Definition sensor_data.hpp:124
Features features_
The features detected in the image.
Definition sensor_data.hpp:123
friend bool operator<(const TriangulatedFeatures &lhs, const TriangulatedFeatures &rhs)
Comparison operator with other imu.
Definition sensor_data.hpp:111