From 8f5fc98188ef6e26f645b68e4f7d3f3a7d18505a Mon Sep 17 00:00:00 2001 From: Damon Kohler Date: Tue, 11 Oct 2016 11:22:33 +0200 Subject: [PATCH] Improves logging, fixes #94. (#41) --- cartographer/common/ordered_multi_queue.h | 4 ++-- cartographer/mapping_3d/motion_filter.cc | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cartographer/common/ordered_multi_queue.h b/cartographer/common/ordered_multi_queue.h index aeec4b0..2b6294a 100644 --- a/cartographer/common/ordered_multi_queue.h +++ b/cartographer/common/ordered_multi_queue.h @@ -66,8 +66,8 @@ class OrderedMultiQueue { auto* queue = FindOrNull(queue_key); if (queue == nullptr) { // TODO(damonkohler): This will not work for every value of "queue_key". - LOG_EVERY_N(WARNING, 60) << "Ignored value for queue: '" << queue_key - << "'"; + LOG_EVERY_N(WARNING, 1000) << "Ignored value for queue: '" << queue_key + << "'"; return; } queue->queue.Push( diff --git a/cartographer/mapping_3d/motion_filter.cc b/cartographer/mapping_3d/motion_filter.cc index cefcddf..cf6803a 100644 --- a/cartographer/mapping_3d/motion_filter.cc +++ b/cartographer/mapping_3d/motion_filter.cc @@ -39,8 +39,9 @@ MotionFilter::MotionFilter(const proto::MotionFilterOptions& options) bool MotionFilter::IsSimilar(const common::Time time, const transform::Rigid3d& pose) { - LOG_EVERY_N(INFO, 500) << "Motion filter reduced the number of scans to " - << 100. * num_different_ / num_total_ << "%."; + LOG_IF_EVERY_N(INFO, num_total_ >= 500, 500) + << "Motion filter reduced the number of scans to " + << 100. * num_different_ / num_total_ << "%."; ++num_total_; if (num_total_ > 1 && time - last_time_ <= common::FromSeconds(options_.max_time_seconds()) &&