From 53a1f6c2f7e3b663e4c10736eb52f3ada6f88605 Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Thu, 3 Jan 2019 10:03:48 +0100 Subject: [PATCH] Small fixes for PoseExtrapolator::UpdateVelocitiesFromPoses() (#1492) - use `pose_queue_duration_` instead of hardcoded "0.001" (cartographer_ros sets this to 0.001, probably that's why this wasn't noticed) - queue_delta is in seconds, log message said milliseconds --- cartographer/mapping/pose_extrapolator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cartographer/mapping/pose_extrapolator.cc b/cartographer/mapping/pose_extrapolator.cc index 64aeda7..d02fd5b 100644 --- a/cartographer/mapping/pose_extrapolator.cc +++ b/cartographer/mapping/pose_extrapolator.cc @@ -164,9 +164,9 @@ void PoseExtrapolator::UpdateVelocitiesFromPoses() { const TimedPose& oldest_timed_pose = timed_pose_queue_.front(); const auto oldest_time = oldest_timed_pose.time; const double queue_delta = common::ToSeconds(newest_time - oldest_time); - if (queue_delta < 0.001) { // 1 ms + if (queue_delta < common::ToSeconds(pose_queue_duration_)) { LOG(WARNING) << "Queue too short for velocity estimation. Queue duration: " - << queue_delta << " ms"; + << queue_delta << " s"; return; } const transform::Rigid3d& newest_pose = newest_timed_pose.pose;