ScanPosition.hpp
Go to the documentation of this file.
1 
2 #ifndef LVR2_IO_YAML_SCANPOSMETA_IO_HPP
3 #define LVR2_IO_YAML_SCANPOSMETA_IO_HPP
4 
5 #include <yaml-cpp/yaml.h>
7 #include "MatrixIO.hpp"
8 
9 namespace YAML {
10 
17 // WRITE SCAN PARTIALLY
18 template <>
19 struct convert<lvr2::ScanPosition>
20 {
21 
25  static Node encode(const lvr2::ScanPosition& scanPos) {
26  Node node;
27 
28  node["sensor_type"] = lvr2::ScanPosition::sensorType;
29  node["latitude"] = scanPos.latitude;
30  node["longitude"] = scanPos.longitude;
31  node["altitude"] = scanPos.altitude;
32  node["pose_estimate"] = scanPos.pose_estimate;
33  node["registration"] = scanPos.registration;
34  node["timestamp"] = scanPos.timestamp;
35 
36  return node;
37  }
38 
39  static bool decode(const Node& node, lvr2::ScanPosition& scanPos) {
40 
41  if(node["sensor_type"].as<std::string>() != lvr2::ScanPosition::sensorType)
42  {
43  return false;
44  }
45 
46  scanPos.latitude = node["latitude"].as<double>();
47  scanPos.longitude = node["longitude"].as<double>();
48  scanPos.altitude = node["altitude"].as<double>();
49 
50  scanPos.pose_estimate = node["pose_estimate"].as<lvr2::Transformd>();
51  scanPos.registration = node["registration"].as<lvr2::Transformd>();
52 
53  scanPos.timestamp = node["timestamp"].as<double>();
54 
55  return true;
56  }
57 
58 };
59 
60 } // namespace YAML
61 
62 #endif // LVR2_IO_YAML_SCANPOSMETA_IO_HPP
63 
YAML::convert< lvr2::ScanPosition >::encode
static Node encode(const lvr2::ScanPosition &scanPos)
Definition: ScanPosition.hpp:25
lvr2::ScanPosition::latitude
double latitude
Latitude (optional)
Definition: ScanTypes.hpp:296
lvr2::ScanPosition::timestamp
double timestamp
Timestamp when this position was created.
Definition: ScanTypes.hpp:311
lvr2::Transformd
Transform< double > Transformd
4x4 double precision transformation matrix
Definition: MatrixTypes.hpp:71
YAML::convert< lvr2::ScanPosition >::decode
static bool decode(const Node &node, lvr2::ScanPosition &scanPos)
Definition: ScanPosition.hpp:39
lvr2::ScanPosition::longitude
double longitude
Longitude (optional)
Definition: ScanTypes.hpp:299
YAML
Definition: LSROptionsYamlExtensions.hpp:42
lvr2::ScanPosition::sensorType
static constexpr char sensorType[]
Definition: ScanTypes.hpp:282
ScanTypes.hpp
lvr2::ScanPosition
Definition: ScanTypes.hpp:276
lvr2::convert
void convert(COORD_SYSTEM from, COORD_SYSTEM to, float *point)
Definition: CoordinateTransform.cpp:46
lvr2::ScanPosition::altitude
double altitude
Longitude (optional)
Definition: ScanTypes.hpp:302
MatrixIO.hpp
lvr2::ScanPosition::pose_estimate
Transformd pose_estimate
Estimated pose.
Definition: ScanTypes.hpp:305
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::ScanPosition::registration
Transformd registration
Final registered position in project coordinates.
Definition: ScanTypes.hpp:308


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:25