supereight
reader_tum.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020-2022 Smart Robotics Lab, Imperial College London, Technical University of Munich
3  * SPDX-FileCopyrightText: 2020-2022 Nils Funk
4  * SPDX-FileCopyrightText: 2020-2022 Sotiris Papatheodorou
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef __READER_TUM_HPP
9 #define __READER_TUM_HPP
10 
11 
12 #include <Eigen/Dense>
13 #include <cstdint>
14 #include <fstream>
15 #include <string>
16 
17 #include "reader_base.hpp"
18 #include "se/image/image.hpp"
19 
20 
21 
22 namespace se {
23 
24 
25 
29 class TUMReader : public Reader {
30  public:
35  TUMReader(const ReaderConfig& c);
36 
37 
39  void restart();
40 
41 
46  std::string name() const;
47 
48  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
49 
50  private:
51  static constexpr float tum_inverse_scale_ = 1.0f / 5000.0f;
52  float inverse_scale_;
53 
54  // TODO Allow setting the max_match_timestamp_dist_ and
55  // max_interp_timestamp_dist_ at runtime from the YAML file. Not sure how
56  // to handle this yet since they only apply to the TUM dataset reader.
57  static constexpr double max_match_timestamp_dist_ = 0.02;
58 
59  static constexpr double max_interp_timestamp_dist_ = 10.0 * max_match_timestamp_dist_;
60 
61  std::vector<std::string> depth_filenames_;
62 
63  std::vector<std::string> rgb_filenames_;
64 
65  ReaderStatus nextDepth(Image<float>& depth_image);
66 
67  ReaderStatus nextRGBA(Image<uint32_t>& rgba_image);
68 };
69 
70 
71 
72 } // namespace se
73 
74 
75 #endif
Definition: reader_base.hpp:46
Base abstract class for dataset readers.
Definition: reader_base.hpp:139
std::string name() const
The name of the reader.
TUMReader(const ReaderConfig &c)
Construct a TUMReader from a ReaderConfig.
ReaderStatus
The result of trying to read a depth/RGB image or a pose.
Definition: reader_base.hpp:105
void restart()
Restart reading from the beginning.
Reader for the TUM RGBD dataset.
Definition: reader_tum.hpp:29
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17