ekf_cal  0.4.0
A Kalman filter-based sensor calibration package
gps.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 SENSORS__GPS_HPP_
17 #define SENSORS__GPS_HPP_
18 
19 #include <eigen3/Eigen/Eigen>
20 
21 #include <string>
22 #include <memory>
23 
24 #include "ekf/types.hpp"
25 #include "ekf/update/gps_updater.hpp"
26 #include "infrastructure/debug_logger.hpp"
27 #include "sensors/gps_message.hpp"
28 #include "sensors/sensor.hpp"
29 
35 class GPS : public Sensor
36 {
37 public:
41  typedef struct Parameters : public Sensor::Parameters
42  {
43  Eigen::Vector3d pos_a_in_b {0, 0, 0};
44  Eigen::Vector3d variance {{1, 1, 1}};
45  bool is_extrinsic {false};
46  double pos_stability {1e-9};
48 
53  explicit GPS(GPS::Parameters params);
54 
59  void Callback(const GpsMessage & gps_message);
60 
61 private:
62  std::shared_ptr<EKF> m_ekf;
63  GpsUpdater m_gps_updater;
64 };
65 
66 #endif // SENSORS__GPS_HPP_
GPS Sensor Class.
Definition: gps.hpp:36
GPS::Parameters Parameters
GPS initialization parameters structure.
void Callback(const GpsMessage &gps_message)
Callback method for GPS measurements.
Definition: gps.cpp:48
GPS(GPS::Parameters params)
GPS class constructor.
Definition: gps.cpp:29
Data class for GPS messages.
Definition: gps_message.hpp:29
EKF Updater Class for GPS Sensors.
Definition: gps_updater.hpp:33
Pure base sensor class.
Definition: sensor.hpp:32
GPS initialization parameters structure.
Definition: gps.hpp:42
bool is_extrinsic
Online extrinsic calibration flag.
Definition: gps.hpp:45
Eigen::Vector3d variance
Initial state variance.
Definition: gps.hpp:44
double pos_stability
Position stability.
Definition: gps.hpp:46
Eigen::Vector3d pos_a_in_b
GPS antenna position offset vector.
Definition: gps.hpp:43
Sensor parameter structure.
Definition: sensor.hpp:38