24 #include <boost/foreach.hpp> 25 #include <boost/property_tree/ptree.hpp> 26 #include <boost/property_tree/xml_parser.hpp> 35 boost::property_tree::ptree pt;
37 if (infile.good()) boost::property_tree::read_xml(this->
filePath, pt);
39 boost::property_tree::ptree dataNode;
40 boost::property_tree::ptree transformLaserScan_Node;
41 boost::property_tree::ptree transformPTU_Node;
43 dataNode.put<
double>(
"<xmlattr>.Pan", data.
pan);
44 dataNode.put<
double>(
"<xmlattr>.Tilt", data.
tilt);
46 for (
unsigned int i = 0; i < 4; i++)
48 for (
unsigned int j = 0; j < 4; j++)
50 std::string name =
"<xmlattr>.x_" + std::to_string(i) + std::to_string(j);
52 transformPTU_Node.put<
double>(name, data.
PTU_Frame(i,j));
55 dataNode.add_child(
"FrameLaserscan", transformLaserScan_Node);
56 dataNode.add_child(
"FramePTU", transformPTU_Node);
57 pt.add_child(
"TransformationData.DataSet", dataNode);
59 boost::property_tree::write_xml(this->
filePath, pt,std::locale());
65 std::vector<Transformation_Data> output;
66 boost::property_tree::ptree pt;
68 read_xml(filePath, pt);
70 BOOST_FOREACH(boost::property_tree::ptree::value_type &node, pt.get_child(
"TransformationData"))
72 if (node.first ==
"DataSet")
75 data.
pan = node.second.get<
double>(
"<xmlattr>.Pan");
76 data.
tilt = node.second.get<
double>(
"<xmlattr>.Tilt");
77 boost::property_tree::ptree transformLaserScan_Node = node.second.get_child(
"FrameLaserscan");
78 boost::property_tree::ptree transformPTU_Node = node.second.get_child(
"FramePTU");
79 for (
unsigned int i = 0; i < 4; i++)
81 for (
unsigned int j = 0; j < 4; j++)
83 std::string name =
"<xmlattr>.x_" + std::to_string(i) + std::to_string(j);
85 data.
PTU_Frame(i, j) = transformPTU_Node.get<
double>(name);
88 output.push_back(data);
96 std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d>> re;