supereight
setup_util.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 Smart Robotics Lab, Imperial College London, Technical University of Munich
3  * SPDX-FileCopyrightText: 2021 Nils Funk
4  * SPDX-FileCopyrightText: 2021 Sotiris Papatheodorou
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef SE_SETUP_UTIL_HPP
9 #define SE_SETUP_UTIL_HPP
10 
11 #include <Eigen/Dense>
12 
13 namespace se {
14 
15 static inline Eigen::Vector3f sample_offset_frac = Eigen::Vector3f::Constant(0.5f);
16 
17 // Representation enums
18 enum class Field { TSDF, Occupancy };
19 enum class Colour { On = true, Off = false };
20 enum class Semantics { On = true, Off = false };
21 
22 // Other enums
23 enum class Res { Single, Multi };
24 enum class Integ { Simple, LiDAR, PinholeCamera };
25 enum class Safe { On = true, Off = false }; // Switch between Safe and Sorry
26 
27 enum class AllocMeth { Raycasting, VoxelCarving }; // Allocation method
28 enum class Rep { Surface, Freespace }; // Map representation
29 
33 enum class Sort { SmallToLarge, LargeToSmall };
34 
43 template<typename crtpType, typename T>
44 struct crtp {
46  {
47  return static_cast<T&>(*this);
48  }
49  const T& underlying() const
50  {
51  return static_cast<const T&>(*this);
52  }
53 
54  private:
55  crtp()
56  {
57  }
58  friend crtpType;
59 };
60 
61 } // namespace se
62 
63 #endif // SE_SETUP_UTIL_HPP
Integ
Definition: setup_util.hpp:24
Res
Definition: setup_util.hpp:23
Colour
Definition: setup_util.hpp:19
Definition: pinhole_camera.hpp:44
helper class for static_cast removal.
Definition: setup_util.hpp:44
static Eigen::Vector3f sample_offset_frac
Definition: setup_util.hpp:15
Field
Definition: setup_util.hpp:18
Sort
The enum classes to define the sorting templates.
Definition: setup_util.hpp:33
AllocMeth
Definition: setup_util.hpp:27
Rep
Definition: setup_util.hpp:28
Semantics
Definition: setup_util.hpp:20
Safe
Definition: setup_util.hpp:25
const T & underlying() const
Definition: setup_util.hpp:49
T & underlying()
Definition: setup_util.hpp:45
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17