supereight2
Loading...
Searching...
No Matches
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#include <optional>
16#include <se/common/rgb.hpp>
17#include <se/common/rgba.hpp>
18#include <se/image/image.hpp>
22
23
24
25namespace se {
26namespace raycaster {
27
30 const bool is_lhc = false);
31
32template<typename MapT>
33inline typename std::enable_if_t<MapT::fld_ == se::Field::Occupancy, std::optional<Eigen::Vector4f>>
35 const typename MapT::OctreeType& octree,
36 const Eigen::Vector3f& ray_origin_W,
37 const Eigen::Vector3f& ray_dir_W,
38 const float t_near,
39 const float t_far,
40 const float mu,
41 const float step,
42 const float largestep);
43
44template<typename MapT>
45inline typename std::enable_if_t<MapT::fld_ == se::Field::TSDF, std::optional<Eigen::Vector4f>>
47 const typename MapT::OctreeType& octree,
48 const Eigen::Vector3f& ray_origin_W,
49 const Eigen::Vector3f& ray_dir_W,
50 const float t_near,
51 const float t_far,
52 const float mu,
53 const float step,
54 const float largestep);
55
56template<typename MapT, typename SensorT>
57void raycast_volume(const MapT& map,
58 const SensorT& sensor,
59 const Eigen::Isometry3f& T_WS,
64 se::Image<id_t>* surface_id = nullptr);
65
82template<typename GetDiffuseColourF>
87 const Eigen::Vector3f& light_source_W = Eigen::Vector3f::Zero(),
88 const RGB ambient_light = RGB{0x1A, 0x1A, 0x1A});
89
97 const Eigen::Vector3f& light_source_W = Eigen::Vector3f::Zero(),
98 const RGB ambient_light = RGB{0x1A, 0x1A, 0x1A});
99
108 const Eigen::Vector3f& light_source_W = Eigen::Vector3f::Zero(),
109 const RGB ambient_light = RGB{0x1A, 0x1A, 0x1A});
110
115template<typename MapT, typename SensorT>
117 const Image<float>& depth,
118 const SensorT& sensor,
119 const Eigen::Isometry3f& T_WC);
120
121} // namespace raycaster
122} // namespace se
123
124#include "impl/raycaster_impl.hpp"
125
126#endif // SE_RAYCASTER_HPP
Definition image.hpp:19
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_colour(se::Image< RGBA > &render, const se::Image< Eigen::Vector3f > &surface_points_W, const se::Image< Eigen::Vector3f > &surface_normals_W, const se::Image< RGB > &surface_colour, const Eigen::Vector3f &light_source_W=Eigen::Vector3f::Zero(), const RGB ambient_light=RGB{0x1A, 0x1A, 0x1A})
Render the surface represented by surface_points_W and surface_normals_W into render,...
void raycast_volume(const MapT &map, const SensorT &sensor, const Eigen::Isometry3f &T_WS, se::Image< Eigen::Vector3f > &surface_point_cloud_W, se::Image< Eigen::Vector3f > &surface_normals_W, se::Image< int8_t > &surface_scale, se::Image< colour_t > *surface_colour=nullptr, se::Image< id_t > *surface_id=nullptr)
void render_volume(se::Image< RGBA > &render, const se::Image< Eigen::Vector3f > &surface_points_W, const se::Image< Eigen::Vector3f > &surface_normals_W, const GetDiffuseColourF get_diffuse_colour, const Eigen::Vector3f &light_source_W=Eigen::Vector3f::Zero(), const RGB ambient_light=RGB{0x1A, 0x1A, 0x1A})
Render the surface represented by surface_points_W and surface_normals_W into render.
void render_volume_scale(se::Image< RGBA > &render, const se::Image< Eigen::Vector3f > &surface_points_W, const se::Image< Eigen::Vector3f > &surface_normals_W, const se::Image< int8_t > &surface_scale, const Eigen::Vector3f &light_source_W=Eigen::Vector3f::Zero(), const RGB ambient_light=RGB{0x1A, 0x1A, 0x1A})
Render the surface represented by surface_points_W and surface_normals_W into render,...
void point_cloud_to_normal(se::Image< Eigen::Vector3f > &normals, const se::Image< Eigen::Vector3f > &point_cloud, const bool is_lhc=false)
Image< id_t > lookup_ids(const MapT &map, const Image< float > &depth, const SensorT &sensor, const Eigen::Isometry3f &T_WC)
Given a map map and a depth image depth and the sensor characteristics as provided by sensor and the ...
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
A colour represented as a Red-Green-Blue tuple with 8-bits per channel.
Definition rgb.hpp:18