Fix the local SLAM latency metric. (#1231)

Before, the metric was in integer seconds and since measurements
are usually quite small, it was mostly outputting 0.
master
Wolfgang Hess 2018-07-03 16:35:58 +02:00 committed by Wally B. Feed
parent ddce76d9fb
commit d2f3c1ea31
2 changed files with 4 additions and 2 deletions

View File

@ -241,7 +241,8 @@ LocalTrajectoryBuilder2D::AddAccumulatedRangeData(
pose_estimate, gravity_alignment.rotation()); pose_estimate, gravity_alignment.rotation());
auto duration = std::chrono::steady_clock::now() - accumulation_started_; auto duration = std::chrono::steady_clock::now() - accumulation_started_;
kLocalSlamLatencyMetric->Set( kLocalSlamLatencyMetric->Set(
std::chrono::duration_cast<std::chrono::seconds>(duration).count()); std::chrono::duration_cast<std::chrono::duration<double>>(duration)
.count());
return common::make_unique<MatchingResult>( return common::make_unique<MatchingResult>(
MatchingResult{time, pose_estimate, std::move(range_data_in_local), MatchingResult{time, pose_estimate, std::move(range_data_in_local),
std::move(insertion_result)}); std::move(insertion_result)});

View File

@ -241,7 +241,8 @@ LocalTrajectoryBuilder3D::AddAccumulatedRangeData(
low_resolution_point_cloud_in_tracking, pose_estimate, gravity_alignment); low_resolution_point_cloud_in_tracking, pose_estimate, gravity_alignment);
auto duration = std::chrono::steady_clock::now() - accumulation_started_; auto duration = std::chrono::steady_clock::now() - accumulation_started_;
kLocalSlamLatencyMetric->Set( kLocalSlamLatencyMetric->Set(
std::chrono::duration_cast<std::chrono::seconds>(duration).count()); std::chrono::duration_cast<std::chrono::duration<double>>(duration)
.count());
return common::make_unique<MatchingResult>(MatchingResult{ return common::make_unique<MatchingResult>(MatchingResult{
time, pose_estimate, std::move(filtered_range_data_in_local), time, pose_estimate, std::move(filtered_range_data_in_local),
std::move(insertion_result)}); std::move(insertion_result)});