ekf_cal  0.4.0
A Kalman filter-based sensor calibration package
tracker.hpp
1 // Copyright 2024 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 TRACKERS__TRACKER_HPP_
17 #define TRACKERS__TRACKER_HPP_
18 
19 #include <memory>
20 #include <string>
21 
22 #include "ekf/ekf.hpp"
23 #include "ekf/types.hpp"
24 #include "infrastructure/debug_logger.hpp"
25 
30 class Tracker
31 {
32 public:
36  typedef struct Parameters
37  {
38  std::string name {""};
39  int camera_id{-1};
40  std::string log_directory {""};
42  unsigned int min_track_length{2};
43  unsigned int max_track_length{20};
44  double data_log_rate {0.0};
45  std::shared_ptr<DebugLogger> logger;
46  std::shared_ptr<EKF> ekf;
48 
53  explicit Tracker(Parameters params);
54 
59  unsigned int GetID();
60 
61 protected:
62  unsigned int m_id;
64  unsigned int m_min_track_length{2};
65  unsigned int m_max_track_length{20};
66  std::shared_ptr<EKF> m_ekf;
67  std::shared_ptr<DebugLogger> m_logger;
68 
69 private:
70  static unsigned int m_tracker_count;
71 };
72 
73 #endif // TRACKERS__TRACKER_HPP_
Camera intrinsics data structure.
Definition: types.hpp:49
Tracker Class.
Definition: tracker.hpp:31
Tracker(Parameters params)
Tracker Initialization parameters structure.
Definition: tracker.cpp:21
int m_camera_id
Associated camera ID of tracker.
Definition: tracker.hpp:63
unsigned int m_max_track_length
Maximum track length before forced output.
Definition: tracker.hpp:65
std::shared_ptr< EKF > m_ekf
EKF.
Definition: tracker.hpp:66
unsigned int GetID()
Tracker ID getter method.
Definition: tracker.cpp:30
std::shared_ptr< DebugLogger > m_logger
Debug logger.
Definition: tracker.hpp:67
struct Tracker::Parameters Parameters
Tracker Initialization parameters structure.
unsigned int m_min_track_length
Minimum track length to consider.
Definition: tracker.hpp:64
unsigned int m_id
Tracker ID.
Definition: tracker.hpp:62
Tracker Initialization parameters structure.
Definition: tracker.hpp:37
unsigned int min_track_length
Minimum track length to consider.
Definition: tracker.hpp:42
std::string name
Feature Tracker name.
Definition: tracker.hpp:38
std::shared_ptr< EKF > ekf
EKF to update.
Definition: tracker.hpp:46
Intrinsics intrinsics
Camera intrinsic parameters.
Definition: tracker.hpp:41
double data_log_rate
Data logging rate.
Definition: tracker.hpp:44
std::string log_directory
Feature Tracker data logging directory.
Definition: tracker.hpp:40
unsigned int max_track_length
Maximum track length before forced output.
Definition: tracker.hpp:43
std::shared_ptr< DebugLogger > logger
Debug logger.
Definition: tracker.hpp:45
int camera_id
Associated sensor ID.
Definition: tracker.hpp:39