30 gnss_loc_file_ = loc_file_folder +
"/gnss_loc.txt";
31 lidar_loc_file_ = loc_file_folder +
"/lidar_loc.txt";
32 fusion_loc_file_ = loc_file_folder +
"/fusion_loc.txt";
33 odometry_loc_file_ = loc_file_folder +
"/odometry_loc.txt";
35 if ((gnss_loc_file_handle_ = fopen(gnss_loc_file_.c_str(),
"a")) ==
nullptr) {
36 AERROR <<
"Cannot open gnss localization file!";
39 if ((lidar_loc_file_handle_ = fopen(lidar_loc_file_.c_str(),
"a")) ==
41 AERROR <<
"Cannot open lidar localization file!";
44 if ((fusion_loc_file_handle_ = fopen(fusion_loc_file_.c_str(),
"a")) ==
46 AERROR <<
"Cannot open fusion localization file!";
49 if ((odometry_loc_file_handle_ = fopen(odometry_loc_file_.c_str(),
"a")) ==
51 AERROR <<
"Cannot open odometry localization file!";
56 if (gnss_loc_file_handle_ !=
nullptr) {
57 fclose(gnss_loc_file_handle_);
60 if (lidar_loc_file_handle_ !=
nullptr) {
61 fclose(lidar_loc_file_handle_);
64 if (fusion_loc_file_handle_ !=
nullptr) {
65 fclose(fusion_loc_file_handle_);
68 if (odometry_loc_file_handle_ !=
nullptr) {
69 fclose(odometry_loc_file_handle_);
74 AINFO <<
"GNSS location callback.";
76 msg.ParseFromString(msg_string);
78 static unsigned int index = 1;
94 fprintf(gnss_loc_file_handle_,
95 "%u %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf\n", index, timestamp,
96 x, y, z, qx, qy, qz, qw, std_x, std_y, std_z);
102 AINFO <<
"Lidar location callback.";
104 msg.ParseFromString(msg_string);
105 static unsigned int index = 1;
127 fprintf(lidar_loc_file_handle_,
128 "%u %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf\n", index, timestamp,
129 x, y, z, qx, qy, qz, qw, std_x, std_y, std_z);
135 AINFO <<
"Fusion location callback.";
137 msg.ParseFromString(msg_string);
138 static unsigned int index = 1;
160 fprintf(fusion_loc_file_handle_,
161 "%u %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf\n", index, timestamp,
162 x, y, z, qx, qy, qz, qw, std_x, std_y, std_z);
168 AINFO <<
"Odometry location callback.";
170 msg.ParseFromString(msg_string);
171 static unsigned int index = 1;
193 fprintf(odometry_loc_file_handle_,
194 "%u %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf\n", index, timestamp,
195 x, y, z, qx, qy, qz, qw, std_x, std_y, std_z);