supereight
Loading...
Searching...
No Matches
multires_ofusion_updater.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019-2021 Smart Robotics Lab, Imperial College London, Technical University of Munich
3 * SPDX-FileCopyrightText: 2019-2021 Nils Funk
4 * SPDX-FileCopyrightText: 2021 Sotiris Papatheodorou
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef SE_MULTIRES_OFUSION_UPDATER_HPP
9#define SE_MULTIRES_OFUSION_UPDATER_HPP
10
12#include <set>
13
14namespace se {
15
16
17
18// Multi-res Occupancy updater
19template<Colour ColB, Semantics SemB, int BlockSize, typename SensorT>
21 public:
23 typedef typename MapType::DataType DataType;
24 typedef typename MapType::OctreeType OctreeType;
25 typedef typename MapType::OctreeType::NodeType NodeType;
26 typedef typename MapType::OctreeType::BlockType BlockType;
27
28
29 struct UpdaterConfig {
30 UpdaterConfig(const MapType& map) :
31 sigma_min(map.getRes() * map.getDataConfig().field.sigma_min_factor),
32 sigma_max(map.getRes() * map.getDataConfig().field.sigma_max_factor),
33 tau_min(map.getRes() * map.getDataConfig().field.tau_min_factor),
34 tau_max(map.getRes() * map.getDataConfig().field.tau_max_factor)
35 {
36 }
37
38 const float sigma_min;
39 const float sigma_max;
40 const float tau_min;
41 const float tau_max;
42 };
43
52
54 std::set<const OctantBase*>* const updated_octants = nullptr);
55
56 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
57
58 private:
62 void propagateToRoot(std::vector<OctantBase*>& block_list);
63
64 void freeBlock(OctantBase* octant_ptr);
65
75 void updateBlock(OctantBase* octant_ptr, bool low_variance, bool project_inside);
76
81 template<bool UpdateBuffer>
82 void updateBlockData(BlockType& block,
83 const Eigen::Vector3f& block_centre_C,
84 const int scale,
85 const bool low_variance,
86 const bool project_inside);
87
91 void freeNodeRecurse(OctantBase* octant_ptr, int depth);
92
93 private:
94 MapType& map_;
95 OctreeType& octree_;
96 const SensorT& sensor_;
97 const Image<float>& depth_img_;
98 const Image<float>* const sigma_img_;
99 const Eigen::Isometry3f T_CW_;
100 const SensorT* const colour_sensor_;
101 const Image<colour_t>* const colour_img_;
102 Eigen::Isometry3f T_CcC_;
103 const bool has_colour_;
104 const timestamp_t timestamp_;
105 const float map_res_;
106 const UpdaterConfig config_;
107 std::vector<std::set<OctantBase*>> node_set_;
108 std::vector<OctantBase*> freed_block_list_;
109 std::set<const OctantBase*>* updated_octants_ = nullptr;
110};
111
112
113
114} // namespace se
115
116#include "impl/multires_ofusion_updater_impl.hpp"
117
118#endif // SE_MULTIRES_OFUSION_UPDATER_HPP
Definition image.hpp:19
Definition map.hpp:27
The base class of all octants (se::Node and se::Block) in an se::Octree.
Definition octant.hpp:19
Updater(MapType &map, const timestamp_t timestamp, const Measurements< SensorT > &measurements)
Map< Data< Field::Occupancy, ColB, SemB >, Res::Multi, BlockSize > MapType
Definition multires_ofusion_updater.hpp:22
MapType::DataType DataType
Definition multires_ofusion_updater.hpp:23
MapType::OctreeType OctreeType
Definition multires_ofusion_updater.hpp:24
MapType::OctreeType::BlockType BlockType
Definition multires_ofusion_updater.hpp:26
void operator()(VolumeCarverAllocation &allocation_list, std::set< const OctantBase * > *const updated_octants=nullptr)
MapType::OctreeType::NodeType NodeType
Definition multires_ofusion_updater.hpp:25
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
int timestamp_t
The type of the time stamp.
Definition type_util.hpp:55
Field
Definition setup_util.hpp:18
Definition data.hpp:19
Definition updater.hpp:16
Definition volume_carver.hpp:21