supereight
raycast_carver.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_RAYCAST_CARVER_HPP
10 #define SE_RAYCAST_CARVER_HPP
11 
12 #include "se/common/math_util.hpp"
17 
18 namespace se {
19 namespace fetcher {
20 
21 
22 
23 template<typename MapT, typename SensorT>
24 inline std::vector<se::OctantBase*>
25 frustum(MapT& map, const SensorT& sensor, const Eigen::Matrix4f& T_WS);
26 
27 
28 
29 } // namespace fetcher
30 
31 
32 
33 template<typename MapT, typename SensorT>
35  public:
36  typedef typename MapT::OctreeType OctreeType;
37 
44  RaycastCarverConfig(const MapT& map) :
45  truncation_boundary(map.getRes() * map.getDataConfig().truncation_boundary_factor),
46  band(2 * truncation_boundary)
47  {
48  }
49 
50  const float truncation_boundary;
51  const float band;
52  };
53 
63  RaycastCarver(MapT& map,
64  const SensorT& sensor,
65  const se::Image<float>& depth_img,
66  const Eigen::Matrix4f& T_WS,
67  const int frame);
68 
74  std::vector<se::OctantBase*> operator()();
75 
76  MapT& map_;
77  OctreeType& octree_;
78  const SensorT& sensor_;
80  const Eigen::Matrix4f& T_WS_;
81  const int frame_;
83 };
84 
85 
86 
87 } // namespace se
88 
89 #include "impl/raycast_carver_impl.hpp"
90 
91 #endif // SE_RAYCAST_CARVER_HPP
const float truncation_boundary
Definition: raycast_carver.hpp:50
const float band
Definition: raycast_carver.hpp:51
const RaycastCarverConfig config_
Definition: raycast_carver.hpp:82
const int frame_
Definition: raycast_carver.hpp:81
const Eigen::Matrix4f & T_WS_
Definition: raycast_carver.hpp:80
MapT & map_
Definition: raycast_carver.hpp:76
Definition: raycast_carver.hpp:34
const se::Image< float > & depth_img_
Definition: raycast_carver.hpp:79
MapT::OctreeType OctreeType
Definition: raycast_carver.hpp:36
std::vector< se::OctantBase * > frustum(MapT &map, const SensorT &sensor, const Eigen::Matrix4f &T_WS)
Return the currently allocated Blocks that intersect the camera frustum.
The config file of the raycast carver.
Definition: raycast_carver.hpp:43
OctreeType & octree_
Definition: raycast_carver.hpp:77
const SensorT & sensor_
Definition: raycast_carver.hpp:78
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17
RaycastCarverConfig(const MapT &map)
Definition: raycast_carver.hpp:44