optimization_main.cpp
Go to the documentation of this file.
1 
18 #ifndef Q_MOC_RUN
19 #include <ros/ros.h>
20 #include <ros/init.h>
21 #endif
24 
25 /*
26  * optimization_main.cpp
27  *
28  * Created on: 16.09.2015
29  * Author: Florian Aumann
30  */
31 std::vector<Transformation_Data> readTransformationFile(string fileName)
32 {
33  std::vector<Transformation_Data> data;
34  ROS_INFO_STREAM("Reading file " << fileName << "...");
35  std::ifstream infile(fileName);
36  if (infile.good())
37  {
38  TransformationFile_Manager_XML fileManager(fileName);
39  try
40  {
41  data = fileManager.readFromFile();
42  }
43  catch (...)
44  {
45  ROS_ERROR("Could not read file.");
46  }
47  }
48  else
49  {
50  ROS_ERROR("File does not exist.");
51  }
52  return data;
53 }
54 
55 
56 int main(int argc, char *argv[])
57 {
58  char *arg[0];
59  int x = 0;
60  ROS_INFO("Init ROS");
61  ros::init(x, arg, "optimizer");
62  if (argc > 0)
63  {
64  **++argv;
65  std::string fileName = *argv;
66  std::vector<Transformation_Data> transformationData = readTransformationFile(fileName);
67  ROS_INFO_STREAM("Got " << transformationData.size() << " datasets.");
68  }
69  else
70  {
71  ROS_ERROR("No data file specified.");
72  }
73  return 0;
74 }
75 
76 
77 
78 
79 
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char *argv[])
std::vector< Transformation_Data > readFromFile(string filePath)
#define ROS_INFO(...)
#define ROS_INFO_STREAM(args)
std::vector< Transformation_Data > readTransformationFile(string fileName)
#define ROS_ERROR(...)


asr_mild_calibration_tool
Author(s): Aumann Florian, Heller Florian, Meißner Pascal
autogenerated on Mon Dec 2 2019 03:11:43