mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
sensor_interface.h
Go to the documentation of this file.
1 // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria.
2 //
3 // All rights reserved.
4 //
5 // This software is licensed under the terms of the BSD-2-Clause-License with
6 // no commercial use allowed, the full terms of which are made available
7 // in the LICENSE file. No license in patents is granted.
8 //
9 // You can contact the author at <christian.brommer@ieee.org>
10 
11 #ifndef SENSORINTERFACE_H
12 #define SENSORINTERFACE_H
13 
14 #include <mars/time.h>
17 #include <Eigen/Dense>
18 #include <memory>
19 
20 namespace mars
21 {
23 {
24 public:
25  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
26 
27  virtual ~SensorInterface() = default;
28 
33  virtual void set_initial_calib(std::shared_ptr<void> calibration) = 0;
34 
42  virtual BufferDataType Initialize(const Time& timestamp, std::shared_ptr<void> measurement,
43  std::shared_ptr<CoreType> latest_core_data) = 0;
54  virtual bool CalcUpdate(const Time& timestamp, std::shared_ptr<void> measurement,
55  const CoreStateType& prior_core_state_data, std::shared_ptr<void> latest_sensor_data,
56  const Eigen::MatrixXd& prior_cov, BufferDataType* new_state_data) = 0;
64  virtual Eigen::MatrixXd get_covariance(const std::shared_ptr<void>& sensor_data) = 0;
65 
66 protected:
67  // SensorInterface(); // construction for child classes only
68 };
69 } // namespace mars
70 #endif // SENSORINTERFACE_H
The BufferDataType binds the core and sensor state in form of a shared void pointer.
Definition: buffer_data_type.h:36
Definition: core_state_type.h:21
Definition: sensor_interface.h:23
virtual BufferDataType Initialize(const Time &timestamp, std::shared_ptr< void > measurement, std::shared_ptr< CoreType > latest_core_data)=0
Initialize the state of an individual sensor.
virtual void set_initial_calib(std::shared_ptr< void > calibration)=0
set_initial_calib Sets the calibration of an individual sensor
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW ~SensorInterface()=default
virtual bool CalcUpdate(const Time &timestamp, std::shared_ptr< void > measurement, const CoreStateType &prior_core_state_data, std::shared_ptr< void > latest_sensor_data, const Eigen::MatrixXd &prior_cov, BufferDataType *new_state_data)=0
CalcUpdate Calculates the update for an individual sensor definition.
virtual Eigen::MatrixXd get_covariance(const std::shared_ptr< void > &sensor_data)=0
get_covariance Resolves a void pointer to the covariance matrix of the corresponding sensor type Each...
Definition: time.h:20
Definition: buffer.h:27