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
Class has useful feature representation types.
static bool is_relative_representation(Representation feat_representation)
Helper function that checks if the passed feature representation is a relative or global...
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...
Dynamic type system types.
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...
Representation
What feature representation our state can use.


ov_core
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Wed Jun 21 2023 03:05:36