My Project 1.0
Holistic Fusion: A Generic Framework for Multimodal Sensor Fusion
Loading...
Searching...
No Matches
TimeGraphKeyBuffer.h
Go to the documentation of this file.
1/*
2Copyright 2023 by Julian Nubert, Robotic Systems Lab, ETH Zurich.
3All rights reserved.
4This file is released under the "BSD-3-Clause License".
5Please see the LICENSE file that has been included as part of this package.
6 */
7
8#ifndef TIMEGRAPHKEYBUFFER_H
9#define TIMEGRAPHKEYBUFFER_H
10
11// C++
12#include <map>
13#include <mutex>
14
15// GTSAM
16#include <gtsam/base/Vector.h>
17
18namespace holistic_fusion {
19
20typedef std::map<double, gtsam::Key> TimeToKeyMap;
21typedef std::map<gtsam::Key, double> KeyToTimeMap;
22
24 public:
25 // Constructor
26 TimeGraphKeyBuffer(const int bufferLength, const int verboseLevel) : bufferLength_(bufferLength), verboseLevel_(verboseLevel){};
27
28 // Destructor
30
31 // Getters
32 bool getClosestKeyAndTimestamp(double& tInGraph, gtsam::Key& key, const std::string& callingName, const double maxSearchDeviation,
33 const double tK);
37
38 // Add to buffers
39 void addToBuffer(const double ts, const gtsam::Key& key);
40
41 private:
42 // Key buffer
45 // Mutex
47 // Verbose level
49 int bufferLength_ = -1;
50 double tLatestInBuffer_ = 0.0;
51};
52
53} // namespace holistic_fusion
54
55#endif // TIMEGRAPHKEYBUFFER_H
TimeGraphKeyBuffer(const int bufferLength, const int verboseLevel)
const TimeToKeyMap & getTimeToKeyBuffer()
const KeyToTimeMap & getKeyToTimeBuffer()
void addToBuffer(const double ts, const gtsam::Key &key)
bool getClosestKeyAndTimestamp(double &tInGraph, gtsam::Key &key, const std::string &callingName, const double maxSearchDeviation, const double tK)
std::map< gtsam::Key, double > KeyToTimeMap
std::map< double, gtsam::Key > TimeToKeyMap