From 015519cf2319c0c9b28f9e4197b1014678d9cc50 Mon Sep 17 00:00:00 2001 From: Damon Kohler Date: Mon, 21 Nov 2016 17:28:50 +0100 Subject: [PATCH] Adds support for inverted LaserScan messages. (#138) --- cartographer/sensor/laser.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cartographer/sensor/laser.cc b/cartographer/sensor/laser.cc index 6015183..d5ce47f 100644 --- a/cartographer/sensor/laser.cc +++ b/cartographer/sensor/laser.cc @@ -40,8 +40,11 @@ std::vector ReorderReflectivities( PointCloud ToPointCloud(const proto::LaserScan& proto) { CHECK_GE(proto.range_min(), 0.f); CHECK_GE(proto.range_max(), proto.range_min()); - CHECK_GT(proto.angle_increment(), 0.f); - CHECK_GT(proto.angle_max(), proto.angle_min()); + if (proto.angle_increment() > 0.f) { + CHECK_GT(proto.angle_max(), proto.angle_min()); + } else { + CHECK_GT(proto.angle_min(), proto.angle_max()); + } PointCloud point_cloud; float angle = proto.angle_min(); for (const auto& range : proto.range()) {