MSCEqF 1.0
Multi State Constraint Equivariant Filter for visual inertial navigation
Loading...
Searching...
No Matches
track_manager.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 BSD-2-Clause-License with
7// no commercial use allowed, the full terms of which are made available
8// in the LICENSE file. No license in patents is granted.
9//
10// You can contact the authors at <alessandro.fornasier@ieee.org>
11
12#ifndef TRACK_MANAGER_HPP
13#define TRACK_MANAGER_HPP
14
15#include <opencv2/opencv.hpp>
16#include <unordered_set>
17
18#include "types/fptypes.hpp"
19#include "vision/tracker.hpp"
20
21namespace msceqf
22{
28{
29 public:
36 TrackManager(const TrackManagerOptions& opts, const Vector4& intrinsics);
37
44
51
57 const Tracks& tracks() const;
58
68 void tracksIds(const fp& timestamp, std::unordered_set<uint>& active_ids, std::unordered_set<uint>& lost_ids) const;
69
77 void activeTracksIds(const fp& timestamp, std::unordered_set<uint>& active_ids) const;
78
86 void lostTracksIds(const fp& timestamp, std::unordered_set<uint>& lost_ids) const;
87
95 void removeTracksId(const std::unordered_set<uint>& ids);
96
105 void removeTracksTail(const fp& timestamp, const bool& remove_equal = true);
106
111 inline void clear() { tracks_.clear(); }
112
118 const PinholeCameraUniquePtr& cam() const;
119
120 private:
125 void updateTracks();
126
127 Tracker tracker_;
128 Tracks tracks_;
129
130 size_t max_track_length_;
131};
132
133} // namespace msceqf
134
135#endif // TRACK_MANAGER_HPP
This class manages the multiple tracks of feature traked in time.
Definition track_manager.hpp:28
void activeTracksIds(const fp &timestamp, std::unordered_set< uint > &active_ids) const
Get all the ids corresponding to active tracks at a given timestamp. Active tracks are defined as tra...
void lostTracksIds(const fp &timestamp, std::unordered_set< uint > &lost_ids) const
Get all the ids corresponding to lost tracks at a given timestamp. Lost tracks are defined as tracks ...
void processCamera(Camera &cam)
Process a single camera measurement. Forward camera measurement to tracker, and update tracks.
void clear()
Clear all the tracks.
Definition track_manager.hpp:111
void removeTracksTail(const fp &timestamp, const bool &remove_equal=true)
Remove the tail of tracks. This method remove from each track all the coordinates as well as the time...
void processFeatures(const TriangulatedFeatures &features)
Process a single features measurement. update tracks.
void tracksIds(const fp &timestamp, std::unordered_set< uint > &active_ids, std::unordered_set< uint > &lost_ids) const
Get all the ids corresponding to active and lost tracks at a given timestamp. Active tracks are defin...
TrackManager(const TrackManagerOptions &opts, const Vector4 &intrinsics)
TrackManager constructor.
const Tracks & tracks() const
Get all the tracks.
void removeTracksId(const std::unordered_set< uint > &ids)
Remove all the tracks corresponding to given ids.
const PinholeCameraUniquePtr & cam() const
Get the camera pointer.
This class implement the feature tracker module based on Lucas-Kanade optical flow....
Definition tracker.hpp:31
Definition sensor_data.hpp:78
Definition msceqf_options.hpp:200
Definition sensor_data.hpp:98