Main Page
Classes
Files
File List
File Members
src
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
22
#include <
Optimization/abstract_optimizer.h
>
23
#include <
Transformation/transformationfile_manager_XML.h
>
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
init.h
TransformationFile_Manager_XML
Definition:
transformationfile_manager_XML.h:25
ros::init
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
abstract_optimizer.h
main
int main(int argc, char *argv[])
Definition:
optimization_main.cpp:56
TransformationFile_Manager_XML::readFromFile
std::vector< Transformation_Data > readFromFile(string filePath)
Definition:
transformationfile_manager_XML.cpp:63
ROS_INFO
#define ROS_INFO(...)
ros.h
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
readTransformationFile
std::vector< Transformation_Data > readTransformationFile(string fileName)
Definition:
optimization_main.cpp:31
transformationfile_manager_XML.h
ROS_ERROR
#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