LandmarkRepresentation.h
Go to the documentation of this file.
1 /*
2  * OpenVINS: An Open Platform for Visual-Inertial Research
3  * Copyright (C) 2018-2023 Patrick Geneva
4  * Copyright (C) 2018-2023 Guoquan Huang
5  * Copyright (C) 2018-2023 OpenVINS Contributors
6  * Copyright (C) 2018-2019 Kevin Eckenhoff
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef OV_TYPE_LANDMARKREPRESENTATION_H
23 #define OV_TYPE_LANDMARKREPRESENTATION_H
24 
25 #include <string>
26 
27 namespace ov_type {
28 
33 
34 public:
46  };
47 
54  static inline std::string as_string(Representation feat_representation) {
55  if (feat_representation == GLOBAL_3D)
56  return "GLOBAL_3D";
57  if (feat_representation == GLOBAL_FULL_INVERSE_DEPTH)
58  return "GLOBAL_FULL_INVERSE_DEPTH";
59  if (feat_representation == ANCHORED_3D)
60  return "ANCHORED_3D";
61  if (feat_representation == ANCHORED_FULL_INVERSE_DEPTH)
62  return "ANCHORED_FULL_INVERSE_DEPTH";
63  if (feat_representation == ANCHORED_MSCKF_INVERSE_DEPTH)
64  return "ANCHORED_MSCKF_INVERSE_DEPTH";
65  if (feat_representation == ANCHORED_INVERSE_DEPTH_SINGLE)
66  return "ANCHORED_INVERSE_DEPTH_SINGLE";
67  return "UNKNOWN";
68  }
69 
76  static inline Representation from_string(const std::string &feat_representation) {
77  if (feat_representation == "GLOBAL_3D")
78  return GLOBAL_3D;
79  if (feat_representation == "GLOBAL_FULL_INVERSE_DEPTH")
81  if (feat_representation == "ANCHORED_3D")
82  return ANCHORED_3D;
83  if (feat_representation == "ANCHORED_FULL_INVERSE_DEPTH")
85  if (feat_representation == "ANCHORED_MSCKF_INVERSE_DEPTH")
87  if (feat_representation == "ANCHORED_INVERSE_DEPTH_SINGLE")
89  return UNKNOWN;
90  }
91 
97  static inline bool is_relative_representation(Representation feat_representation) {
98  return (feat_representation == Representation::ANCHORED_3D || feat_representation == Representation::ANCHORED_FULL_INVERSE_DEPTH ||
99  feat_representation == Representation::ANCHORED_MSCKF_INVERSE_DEPTH ||
100  feat_representation == Representation::ANCHORED_INVERSE_DEPTH_SINGLE);
101  }
102 
103 private:
109 };
110 
111 } // namespace ov_type
112 
113 #endif // OV_TYPE_LANDMARKREPRESENTATION_H
ov_type::LandmarkRepresentation::UNKNOWN
@ UNKNOWN
Definition: LandmarkRepresentation.h:45
ov_type::LandmarkRepresentation::from_string
static Representation from_string(const std::string &feat_representation)
Returns a string representation of this enum value. Used to debug print out what the user has selecte...
Definition: LandmarkRepresentation.h:76
ov_type::LandmarkRepresentation::ANCHORED_MSCKF_INVERSE_DEPTH
@ ANCHORED_MSCKF_INVERSE_DEPTH
Definition: LandmarkRepresentation.h:43
ov_type::LandmarkRepresentation::Representation
Representation
What feature representation our state can use.
Definition: LandmarkRepresentation.h:38
ov_type::LandmarkRepresentation::GLOBAL_FULL_INVERSE_DEPTH
@ GLOBAL_FULL_INVERSE_DEPTH
Definition: LandmarkRepresentation.h:40
ov_type::LandmarkRepresentation::ANCHORED_FULL_INVERSE_DEPTH
@ ANCHORED_FULL_INVERSE_DEPTH
Definition: LandmarkRepresentation.h:42
ov_type::LandmarkRepresentation
Class has useful feature representation types.
Definition: LandmarkRepresentation.h:32
ov_type::LandmarkRepresentation::ANCHORED_INVERSE_DEPTH_SINGLE
@ ANCHORED_INVERSE_DEPTH_SINGLE
Definition: LandmarkRepresentation.h:44
ov_type::LandmarkRepresentation::is_relative_representation
static bool is_relative_representation(Representation feat_representation)
Helper function that checks if the passed feature representation is a relative or global.
Definition: LandmarkRepresentation.h:97
ov_type::LandmarkRepresentation::GLOBAL_3D
@ GLOBAL_3D
Definition: LandmarkRepresentation.h:39
ov_type::LandmarkRepresentation::LandmarkRepresentation
LandmarkRepresentation()
Definition: LandmarkRepresentation.h:108
ov_type
Dynamic type system types.
ov_type::LandmarkRepresentation::ANCHORED_3D
@ ANCHORED_3D
Definition: LandmarkRepresentation.h:41
ov_type::LandmarkRepresentation::as_string
static std::string as_string(Representation feat_representation)
Returns a string representation of this enum value. Used to debug print out what the user has selecte...
Definition: LandmarkRepresentation.h:54


ov_core
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Mon Dec 16 2024 03:06:46