supereight
raycaster.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2016-2019 Emanuele Vespa
3  * SPDX-FileCopyrightText: 2020-2023 Smart Robotics Lab, Imperial College London, Technical University of Munich
4  * SPDX-FileCopyrightText: 2020-2023 Nils Funk
5  * SPDX-FileCopyrightText: 2020-2023 Sotiris Papatheodorou
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef SE_RAYCASTER_HPP
10 #define SE_RAYCASTER_HPP
11 
12 #define INVALID -2
13 
14 #include <optional>
15 
17 #include "se/image/image.hpp"
20 
21 
22 
23 namespace se {
24 namespace raycaster {
25 
27  const se::Image<Eigen::Vector3f>& point_cloud,
28  const bool is_lhc = false);
29 
30 template<typename MapT>
31 inline typename std::enable_if_t<MapT::fld_ == se::Field::Occupancy, std::optional<Eigen::Vector4f>>
32 raycast(MapT& map,
33  const typename MapT::OctreeType& octree,
34  const Eigen::Vector3f& ray_origin_W,
35  const Eigen::Vector3f& ray_dir_W,
36  const float t_near,
37  const float t_far,
38  const float mu,
39  const float step,
40  const float largestep);
41 
42 template<typename MapT>
43 inline typename std::enable_if_t<MapT::fld_ == se::Field::TSDF, std::optional<Eigen::Vector4f>>
44 raycast(MapT& map,
45  const typename MapT::OctreeType& octree,
46  const Eigen::Vector3f& ray_origin_W,
47  const Eigen::Vector3f& ray_dir_W,
48  const float t_near,
49  const float t_far,
50  const float mu,
51  const float step,
52  const float largestep);
53 
54 template<typename MapT, typename SensorT>
55 void raycast_volume(const MapT& map,
56  se::Image<Eigen::Vector3f>& surface_point_cloud_W,
57  se::Image<Eigen::Vector3f>& surface_normals_W,
58  se::Image<int8_t>& surface_scale,
59  const Eigen::Matrix4f& T_WS,
60  const SensorT& sensor);
61 
62 void render_volume_kernel(uint32_t* volume_RGBA_image_data,
63  const Eigen::Vector2i& volume_RGBA_image_res,
64  const Eigen::Vector3f& light_W,
65  const Eigen::Vector3f& ambient_W,
66  const se::Image<Eigen::Vector3f>& surface_point_cloud_W,
67  const se::Image<Eigen::Vector3f>& surface_normals_W,
68  const se::Image<int8_t>& surface_scale);
69 
70 
71 
72 } // namespace raycaster
73 } // namespace se
74 
75 #include "impl/raycaster_impl.hpp"
76 
77 #endif // SE_RAYCASTER_HPP
std::enable_if_t< MapT::fld_==se::Field::Occupancy, std::optional< Eigen::Vector4f > > raycast(MapT &map, const typename MapT::OctreeType &octree, const Eigen::Vector3f &ray_origin_W, const Eigen::Vector3f &ray_dir_W, const float t_near, const float t_far, const float mu, const float step, const float largestep)
void render_volume_kernel(uint32_t *volume_RGBA_image_data, const Eigen::Vector2i &volume_RGBA_image_res, const Eigen::Vector3f &light_W, const Eigen::Vector3f &ambient_W, const se::Image< Eigen::Vector3f > &surface_point_cloud_W, const se::Image< Eigen::Vector3f > &surface_normals_W, const se::Image< int8_t > &surface_scale)
void point_cloud_to_normal(se::Image< Eigen::Vector3f > &normals, const se::Image< Eigen::Vector3f > &point_cloud, const bool is_lhc=false)
void raycast_volume(const MapT &map, se::Image< Eigen::Vector3f > &surface_point_cloud_W, se::Image< Eigen::Vector3f > &surface_normals_W, se::Image< int8_t > &surface_scale, const Eigen::Matrix4f &T_WS, const SensorT &sensor)
Definition: image.hpp:20
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17