Adds support for inverted LaserScan messages. (#138)

master
Damon Kohler 2016-11-21 17:28:50 +01:00 committed by GitHub
parent a39bbff70c
commit 015519cf23
1 changed files with 5 additions and 2 deletions

View File

@ -40,8 +40,11 @@ std::vector<uint8> ReorderReflectivities(
PointCloud ToPointCloud(const proto::LaserScan& proto) { PointCloud ToPointCloud(const proto::LaserScan& proto) {
CHECK_GE(proto.range_min(), 0.f); CHECK_GE(proto.range_min(), 0.f);
CHECK_GE(proto.range_max(), proto.range_min()); CHECK_GE(proto.range_max(), proto.range_min());
CHECK_GT(proto.angle_increment(), 0.f); if (proto.angle_increment() > 0.f) {
CHECK_GT(proto.angle_max(), proto.angle_min()); CHECK_GT(proto.angle_max(), proto.angle_min());
} else {
CHECK_GT(proto.angle_min(), proto.angle_max());
}
PointCloud point_cloud; PointCloud point_cloud;
float angle = proto.angle_min(); float angle = proto.angle_min();
for (const auto& range : proto.range()) { for (const auto& range : proto.range()) {