supereight
Loading...
Searching...
No Matches
data_field.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2022 Smart Robotics Lab, Imperial College London, Technical University of Munich
3 * SPDX-FileCopyrightText: 2021-2022 Nils Funk
4 * SPDX-FileCopyrightText: 2021-2022 Sotiris Papatheodorou
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef SE_DATA_FIELD_HPP
9#define SE_DATA_FIELD_HPP
10
13
14namespace se {
15
17
18template<Field FieldT>
19struct FieldData {
20 struct Config {
21 };
22};
23
24template<>
26 field_t occupancy = 0;
27 weight_t weight = 0;
28 bool observed = false;
29
34 static constexpr bool normals_along_gradient = false;
35 static constexpr field_t surface_boundary = 0;
36 static constexpr field_t min_occupancy = -100;
37 static constexpr field_t max_occupancy = 100;
38
40 bool valid() const;
41
45 bool update(const field_t occupancy, const weight_t max_weight);
46
47 struct Config {
48 float k_sigma = 0.052f;
49 float sigma_min_factor = 1.5f;
50 float sigma_max_factor = 6.0f;
51
52 float k_tau = 0.026f;
53 float tau_min_factor = 6.0f;
54 float tau_max_factor = 16.0f;
55
56 field_t log_odd_min = -5.015;
57 field_t log_odd_max = 5.015;
58
59 weight_t max_weight = std::floor(std::fabs(min_occupancy / (0.97f * log_odd_min)));
60
61 int fs_integr_scale = 1;
62
64
68 void readYaml(const std::string& yaml_file);
69 };
70};
71
72std::ostream& operator<<(std::ostream& os, const FieldData<Field::Occupancy>::Config& c);
73
74template<>
76 struct Config {
77 field_t truncation_boundary_factor = 8;
78 weight_t max_weight = 100;
79
83 void readYaml(const std::string& yaml_file);
84 };
85
86 field_t tsdf = 1;
87 weight_t weight = 0;
88
93 static constexpr bool normals_along_gradient = true;
94 static constexpr field_t surface_boundary = 0;
95
97 bool valid() const;
98
103 bool update(const field_t sdf, const field_t truncation_boundary, const weight_t max_weight);
104};
105
106std::ostream& operator<<(std::ostream& os, const FieldData<Field::TSDF>::Config& c);
107
108} // namespace se
109
110#include "impl/data_field_impl.hpp"
111
112#endif // SE_DATA_FIELD_HPP
Definition image.hpp:19
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
float field_t
The type of the stored field (e.g. TSDF, ESDF or occupancy)
Definition type_util.hpp:49
UncertaintyModel
Definition data_field.hpp:16
Field
Definition setup_util.hpp:18
std::ostream & operator<<(std::ostream &os, const ColourData< Colour::Off >::Config &c)
Definition config.hpp:105
Definition data_field.hpp:20
void readYaml(const std::string &yaml_file)
Reads the struct members from the "data" node of a YAML file.
bool update(const field_t occupancy, const weight_t max_weight)
Perform a weighted average log-odds occupancy update and set the data to observed,...
bool valid() const
Return whether the field data has been updated at least once.
void readYaml(const std::string &yaml_file)
Reads the struct members from the "data" node of a YAML file.
bool valid() const
Return whether the field data has been updated at least once.
bool update(const field_t sdf, const field_t truncation_boundary, const weight_t max_weight)
Perform a weighted average TSDF update by truncating the SDF value sdf within truncation_boundary,...
Definition data_field.hpp:19