sensor_data.h
Go to the documentation of this file.
1 /*
2  * OpenVINS: An Open Platform for Visual-Inertial Research
3  * Copyright (C) 2018-2023 Patrick Geneva
4  * Copyright (C) 2018-2023 Guoquan Huang
5  * Copyright (C) 2018-2023 OpenVINS Contributors
6  * Copyright (C) 2018-2019 Kevin Eckenhoff
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef OV_CORE_SENSOR_DATA_H
23 #define OV_CORE_SENSOR_DATA_H
24 
25 #include <Eigen/Eigen>
26 #include <opencv2/opencv.hpp>
27 #include <vector>
28 
29 namespace ov_core {
30 
34 struct ImuData {
35 
37  double timestamp;
38 
40  Eigen::Matrix<double, 3, 1> wm;
41 
43  Eigen::Matrix<double, 3, 1> am;
44 
46  bool operator<(const ImuData &other) const { return timestamp < other.timestamp; }
47 };
48 
55 struct CameraData {
56 
58  double timestamp;
59 
61  std::vector<int> sensor_ids;
62 
64  std::vector<cv::Mat> images;
65 
67  std::vector<cv::Mat> masks;
68 
70  bool operator<(const CameraData &other) const {
71  if (timestamp == other.timestamp) {
72  int id = *std::min_element(sensor_ids.begin(), sensor_ids.end());
73  int id_other = *std::min_element(other.sensor_ids.begin(), other.sensor_ids.end());
74  return id < id_other;
75  } else {
76  return timestamp < other.timestamp;
77  }
78  }
79 };
80 
81 } // namespace ov_core
82 
83 #endif // OV_CORE_SENSOR_DATA_H
ov_core::CameraData::images
std::vector< cv::Mat > images
Raw image we have collected for each camera.
Definition: sensor_data.h:64
ov_core::CameraData
Struct for a collection of camera measurements.
Definition: sensor_data.h:55
ov_core::CameraData::operator<
bool operator<(const CameraData &other) const
Sort function to allow for using of STL containers.
Definition: sensor_data.h:70
ov_core::CameraData::sensor_ids
std::vector< int > sensor_ids
Camera ids for each of the images collected.
Definition: sensor_data.h:61
ov_core::CameraData::timestamp
double timestamp
Timestamp of the reading.
Definition: sensor_data.h:58
ov_core::CameraData::masks
std::vector< cv::Mat > masks
Tracking masks for each camera we have.
Definition: sensor_data.h:67
ov_core::ImuData::wm
Eigen::Matrix< double, 3, 1 > wm
Gyroscope reading, angular velocity (rad/s)
Definition: sensor_data.h:40
ov_core::ImuData
Struct for a single imu measurement (time, wm, am)
Definition: sensor_data.h:34
ov_core::ImuData::am
Eigen::Matrix< double, 3, 1 > am
Accelerometer reading, linear acceleration (m/s^2)
Definition: sensor_data.h:43
ov_core::ImuData::operator<
bool operator<(const ImuData &other) const
Sort function to allow for using of STL containers.
Definition: sensor_data.h:46
ov_core::ImuData::timestamp
double timestamp
Timestamp of the reading.
Definition: sensor_data.h:37
ov_core
Core algorithms for OpenVINS.
Definition: CamBase.h:30


ov_core
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Mon Dec 16 2024 03:06:46