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 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 TRACK_MANAGER_HPP
21#define TRACK_MANAGER_HPP
22
23#include <opencv2/opencv.hpp>
24#include <unordered_set>
25
26#include "types/fptypes.hpp"
27#include "vision/tracker.hpp"
28
29namespace msceqf
30{
36{
37 public:
44 TrackManager(const TrackManagerOptions& opts, const Vector4& intrinsics);
45
52
59
65 const Tracks& tracks() const;
66
76 void tracksIds(const fp& timestamp, std::unordered_set<uint>& active_ids, std::unordered_set<uint>& lost_ids) const;
77
85 void activeTracksIds(const fp& timestamp, std::unordered_set<uint>& active_ids) const;
86
94 void lostTracksIds(const fp& timestamp, std::unordered_set<uint>& lost_ids) const;
95
103 void removeTracksId(const std::unordered_set<uint>& ids);
104
113 void removeTracksTail(const fp& timestamp, const bool& remove_equal = true);
114
119 inline void clear() { tracks_.clear(); }
120
126 const PinholeCameraUniquePtr& cam() const;
127
128 private:
133 void updateTracks();
134
135 Tracker tracker_;
136 Tracks tracks_;
137
138 size_t max_track_length_;
139};
140
141} // namespace msceqf
142
143#endif // TRACK_MANAGER_HPP
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:119
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:39
Definition sensor_data.hpp:86
Definition msceqf_options.hpp:208
Definition sensor_data.hpp:106