supereight
singleres_tsdf_updater.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2016-2019 Emanuele Vespa
3  * SPDX-FileCopyrightText: 2021 Smart Robotics Lab, Imperial College London, Technical University of Munich
4  * SPDX-FileCopyrightText: 2021 Nils Funk
5  * SPDX-FileCopyrightText: 2021 Sotiris Papatheodorou
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef SE_SINGLERES_TSDF_UPDATER_HPP
10 #define SE_SINGLERES_TSDF_UPDATER_HPP
11 
12 
13 
14 #include "se/map/map.hpp"
15 #include "se/sensor/sensor.hpp"
16 
17 
18 
19 namespace se {
20 
21 
22 
23 // Single-res TSDF updater
24 template<se::Colour ColB, se::Semantics SemB, int BlockSize, typename SensorT>
25 class Updater<Map<Data<se::Field::TSDF, ColB, SemB>, se::Res::Single, BlockSize>, SensorT> {
26  public:
28  typedef typename MapType::DataType DataType;
29  typedef typename MapType::OctreeType::NodeType NodeType;
30  typedef typename MapType::OctreeType::BlockType BlockType;
31 
32  struct UpdaterConfig {
33  UpdaterConfig(const MapType& map) :
34  truncation_boundary(map.getRes() * map.getDataConfig().truncation_boundary_factor)
35  {
36  }
37 
38  const float truncation_boundary;
39  };
40 
48  Updater(MapType& map,
49  const SensorT& sensor,
50  const se::Image<float>& depth_img,
51  const Eigen::Matrix4f& T_WS,
52  const int frame);
53 
54 
55 
56  void operator()(std::vector<se::OctantBase*>& block_ptrs);
57 
58  private:
59  void updateVoxel(DataType& data, const field_t sdf_value);
60 
61  MapType& map_;
62  const SensorT& sensor_;
63  const se::Image<float>& depth_img_;
64  const Eigen::Matrix4f& T_WS_;
65  const int frame_;
66  const UpdaterConfig config_;
67 };
68 
69 
70 
71 } // namespace se
72 
73 #include "impl/singleres_tsdf_updater_impl.hpp"
74 
75 #endif // SE_SINGLERES_TSDF_UPDATER_HPP
Map< Data< se::Field::TSDF, ColB, SemB >, se::Res::Single, BlockSize > MapType
Definition: singleres_tsdf_updater.hpp:27
Updater(MapT &map, const SensorT &sensor, const se::Image< float > &depth_img, const Eigen::Matrix4f &T_WS, const int frame)
float field_t
The type of the stored field (e.g. TSDF, ESDF or occupancy)
Definition: type_util.hpp:50
Definition: data.hpp:95
Definition: updater.hpp:18
MapType::OctreeType::BlockType BlockType
Definition: singleres_tsdf_updater.hpp:30
MapType::OctreeType::NodeType NodeType
Definition: singleres_tsdf_updater.hpp:29
Definition: map.hpp:64
void operator()(UpdateListT &updating_list)
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17