ScanProject.hpp
Go to the documentation of this file.
1 
2 #ifndef LVR2_IO_YAML_SCANPROJECTMETA_IO_HPP
3 #define LVR2_IO_YAML_SCANPROJECTMETA_IO_HPP
4 
5 #include <yaml-cpp/yaml.h>
7 #include "lvr2/io/Timestamp.hpp"
8 
9 #include "MatrixIO.hpp"
10 
11 namespace YAML {
12 
19 // WRITE SCAN PARTIALLY
20 template <>
21 struct convert<lvr2::ScanProject>
22 {
23 
27  static Node encode(const lvr2::ScanProject& scanProj) {
28  Node node;
29 
30  node["sensor_type"] = lvr2::ScanProject::sensorType;
31 
32  return node;
33  }
34 
35  static bool decode(const Node& node, lvr2::ScanProject& scanProj)
36  {
37  try
38  {
39  if(node["sensor_type"].as<std::string>() != lvr2::ScanProject::sensorType)
40  {
41  return false;
42  }
43  }
44  catch(YAML::BadSubscript& e)
45  {
46  std::cout << e.what() << std::endl;
47  return false;
48  }
49 
50  return true;
51  }
52 
53 };
54 
55 } // namespace YAML
56 
57 #endif // LVR2_IO_YAML_SCANPROJECTMETA_IO_HPP
58 
void convert(COORD_SYSTEM from, COORD_SYSTEM to, float *point)
static constexpr char sensorType[]
Type of used laser scanner.
Definition: ScanTypes.hpp:325
static bool decode(const Node &node, lvr2::ScanProject &scanProj)
Definition: ScanProject.hpp:35
static Node encode(const lvr2::ScanProject &scanProj)
Definition: ScanProject.hpp:27


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