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 
double longitude
Longitude (optional)
Definition: ScanTypes.hpp:295
Transformd registration
Final registered position in project coordinates.
Definition: ScanTypes.hpp:304
void convert(COORD_SYSTEM from, COORD_SYSTEM to, float *point)
double altitude
Longitude (optional)
Definition: ScanTypes.hpp:298
Transform< double > Transformd
4x4 double precision transformation matrix
Definition: MatrixTypes.hpp:71
static constexpr char sensorType[]
Definition: ScanTypes.hpp:278
static Node encode(const lvr2::ScanPosition &scanPos)
static bool decode(const Node &node, lvr2::ScanPosition &scanPos)
double latitude
Latitude (optional)
Definition: ScanTypes.hpp:292
Transformd pose_estimate
Estimated pose.
Definition: ScanTypes.hpp:301
double timestamp
Timestamp when this position was created.
Definition: ScanTypes.hpp:307


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 Mon Feb 28 2022 22:46:09