ekf_cal  0.4.0
A Kalman filter-based sensor calibration package
fiducial_updater.hpp
1 // Copyright 2023 Jacob Hartzer
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but 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 <https://www.gnu.org/licenses/>.
15 
16 #ifndef EKF__UPDATE__FIDUCIAL_UPDATER_HPP_
17 #define EKF__UPDATE__FIDUCIAL_UPDATER_HPP_
18 
19 #include <eigen3/Eigen/Eigen>
20 
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 #include "ekf/types.hpp"
26 #include "ekf/update/updater.hpp"
27 #include "infrastructure/data_logger.hpp"
28 
33 class FiducialUpdater : public Updater
34 {
35 public:
45  explicit FiducialUpdater(
46  int fiducial_id,
47  int camera_id,
48  bool is_cam_extrinsic,
49  const std::string & log_file_directory,
50  double data_log_rate,
51  std::shared_ptr<DebugLogger> logger
52  );
53 
60  void UpdateEKF(EKF & ekf, double time, BoardDetection board_detection);
61 
62 private:
63  bool m_is_cam_extrinsic;
64  DataLogger m_fiducial_logger;
65  unsigned int m_camera_id;
66  bool m_is_first_estimate{true};
67  Eigen::Vector3d m_pos_f_in_l;
68  Eigen::Quaterniond m_ang_f_to_l;
69  Eigen::Vector3d m_pos_c_in_b;
70  Eigen::Quaterniond m_ang_c_to_b;
71 };
72 
73 #endif // EKF__UPDATE__FIDUCIAL_UPDATER_HPP_
DataLogger class.
Definition: data_logger.hpp:26
Calibration EKF class.
Definition: ekf.hpp:39
EKF Updater Class for Fiducial Camera Measurements.
Definition: fiducial_updater.hpp:34
void UpdateEKF(EKF &ekf, double time, BoardDetection board_detection)
EKF updater function.
Definition: fiducial_updater.cpp:66
FiducialUpdater(int fiducial_id, int camera_id, bool is_cam_extrinsic, const std::string &log_file_directory, double data_log_rate, std::shared_ptr< DebugLogger > logger)
MSCKF EKF Updater constructor.
Definition: fiducial_updater.cpp:39
Base class for EKF updater classes.
Definition: updater.hpp:29
BoardDetection structure.
Definition: types.hpp:290