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