MSCEqF 1.0
Multi State Constraint Equivariant Filter for visual inertial navigation
Loading...
Searching...
No Matches
msceqf.hpp
1// Copyright (C) 2023 Alessandro Fornasier.
2// Control of Networked Systems, University of Klagenfurt, Austria.
3//
4// All rights reserved.
5//
6// This software is licensed under the terms of the Apache License, Version 2.0
7// (the "License"); you may not use this file except in compliance with the
8// License. You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15// License for the specific language governing permissions and limitations
16// under the License.
17//
18// You can contact the authors at <alessandro.fornasier@ieee.org>
19
20#ifndef MSCEQF_HPP
21#define MSCEQF_HPP
22
23#include <future>
24
25#include "msceqf/filter/initializer/static_initializer.hpp"
26#include "msceqf/filter/propagator/propagator.hpp"
27#include "msceqf/filter/updater/updater.hpp"
28#include "msceqf/filter/updater/zero_velocity_updater.hpp"
29#include "msceqf/options/msceqf_option_parser.hpp"
30#include "msceqf/state/state.hpp"
31#include "vision/track_manager.hpp"
32#include "utils/visualizer.hpp"
33
34namespace msceqf
35{
36class MSCEqF
37{
38 public:
44 MSCEqF(const std::string& params_filepath);
45
51 void processMeasurement(const Imu& meas) { processImuMeasurement(meas); }
52
58 void processMeasurement(Camera& meas) { processCameraMeasurement(meas); }
59
65 void processMeasurement(TriangulatedFeatures& meas) { processFeaturesMeasurement(meas); }
66
72 const MSCEqFOptions& options() const;
73
79 const StateOptions& stateOptions() const;
80
86 const MatrixX& covariance() const;
87
93 const MatrixX coreCovariance() const;
94
101
107 const SystemState& stateOrigin() const;
108
116 void setGivenOrigin(const SE23& T0, const Vector6& b0, const fp& timestamp);
117
123 const cv::Mat3b imageWithTracks(const Camera& cam) const;
124
130 void visualizeImageWithTracks(const Camera& cam) const;
131
137 [[nodiscard]] const bool& isInit() const;
138
144 [[nodiscard]] const bool& zvuPerformed() const;
145
146 private:
153 void processImuMeasurement(const Imu& imu);
154
166 void processCameraMeasurement(Camera& cam);
167
179 void processFeaturesMeasurement(TriangulatedFeatures& features);
180
188 void initialize(Camera& cam);
189
197 void initialize(TriangulatedFeatures& features);
198
203 void setGivenOrigin();
204
209 void logInit() const;
210
211 OptionParser parser_;
212 MSCEqFOptions opts_;
213
214 SystemState xi0_;
215 MSCEqFState X_;
216 SystemState xi_;
217
218 TrackManager track_manager_;
219 Checker checker_;
220 StaticInitializer initializer_;
221 Propagator propagator_;
222 Updater updater_;
223 ZeroVelocityUpdater zvupdater_;
224 Visualizer visualizer_; //<! The MSCEqF visualizer
225
226 std::unordered_set<uint> ids_to_update_;
227
228 fp timestamp_;
229
230 bool is_filter_initialized_;
231 bool zvu_performed_;
232};
233
234} // namespace msceqf
235
236#endif // MSCEQF_HPP
Simple class to perform various checks.
Definition checker.hpp:35
void setGivenOrigin(const SE23 &T0, const Vector6 &b0, const fp &timestamp)
Set origin xi0 with given state programatically.
void processMeasurement(TriangulatedFeatures &meas)
Process triangulated features measurement.
Definition msceqf.hpp:65
void visualizeImageWithTracks(const Camera &cam) const
Visualize the processed image with overlayed tracks.
const bool & zvuPerformed() const
Check if a zero velocity update has been performed.
const MatrixX & covariance() const
Get a constant reference to the covariance matrix of the MSCEqF state.
const StateOptions & stateOptions() const
Get a constant reference to the MSCEqF state options.
void processMeasurement(const Imu &meas)
Process IMU measurement.
Definition msceqf.hpp:51
const bool & isInit() const
Check if the filter is initialized.
const MatrixX coreCovariance() const
Get the covariance of the navigation states (D, delta).
const cv::Mat3b imageWithTracks(const Camera &cam) const
Get the processed image with overlayed tracks.
MSCEqF(const std::string &params_filepath)
MSCEqF Constructor.
void processMeasurement(Camera &meas)
Process camera measurement.
Definition msceqf.hpp:58
const MSCEqFOptions & options() const
Get a constant reference to the MSCEqF options.
const SystemState & stateEstimate() const
Get a constant reference to the estimated state.
const SystemState & stateOrigin() const
Get a constant reference to the origin state.
this class represent the state of the MSCEqF. This includes the state of the lifted system (element o...
Definition state.hpp:38
Definition msceqf_option_parser.hpp:37
Definition propagator.hpp:33
Definition static_initializer.hpp:29
The SystemState class represent the state of the system posed on the Homogenous space.
Definition system.hpp:37
This class manages the multiple tracks of feature traked in time.
Definition track_manager.hpp:36
Updater class. This class implements the Multi State Constraint update step of the MSCEqF filter.
Definition updater.hpp:38
Definition visualizer.hpp:31
Zero velocity updater class. This class implements the Equivariant Zero Velocity Update (ZVU) of the ...
Definition zero_velocity_updater.hpp:34
Definition sensor_data.hpp:86
Struct for one IMU reading. It includes timestamp, angular velocity and linear acceleration....
Definition sensor_data.hpp:37
Definition msceqf_options.hpp:214
Definition msceqf_options.hpp:106
Definition sensor_data.hpp:106