@@ -185,6 +185,9 @@ NDTScanMatcher::NDTScanMatcher()
185
185
std::make_unique<MapUpdateModule>(this , &ndt_ptr_mtx_, ndt_ptr_, param_.dynamic_map_loading );
186
186
187
187
logger_configure_ = std::make_unique<tier4_autoware_utils::LoggerLevelConfigure>(this );
188
+
189
+ // For debug
190
+ exe_log_file_.open (" /home/anh/Work/autoware/align_cost.csv" );
188
191
}
189
192
190
193
void NDTScanMatcher::publish_diagnostic ()
@@ -330,11 +333,13 @@ void NDTScanMatcher::callback_sensor_points(
330
333
// return;
331
334
}
332
335
336
+ // Put the time counter here to measure the actual processing time
337
+ // = time of waiting for unlock + time of align
338
+ const auto exe_start_time = std::chrono::system_clock::now ();
339
+
333
340
// mutex ndt_ptr_
334
341
std::lock_guard<std::mutex> lock (ndt_ptr_mtx_);
335
342
336
- const auto exe_start_time = std::chrono::system_clock::now ();
337
-
338
343
// preprocess input pointcloud
339
344
pcl::shared_ptr<pcl::PointCloud<PointSource>> sensor_points_in_sensor_frame (
340
345
new pcl::PointCloud<PointSource>);
@@ -425,6 +430,10 @@ void NDTScanMatcher::callback_sensor_points(
425
430
std::chrono::duration_cast<std::chrono::microseconds>(exe_end_time - exe_start_time).count ();
426
431
const auto exe_time = static_cast <float >(duration_micro_sec) / 1000 .0f ;
427
432
433
+ // For debug
434
+ exe_log_file_ << exe_time << " ," << ndt_result.iteration_num << std::endl;
435
+ // End
436
+
428
437
// publish
429
438
initial_pose_with_covariance_pub_->publish (interpolation_result.interpolated_pose );
430
439
exe_time_pub_->publish (make_float32_stamped (sensor_ros_time, exe_time));
0 commit comments