Merge pull request #552 from cwecht/one_channel_lidar

Make single channel lidar possible
This commit is contained in:
Néstor Subirón 2018-08-20 17:01:32 +02:00 committed by GitHub
commit c4381df3ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ void ALidar::CreateLasers()
check(Description != nullptr);
const auto NumberOfLasers = Description->Channels;
check(NumberOfLasers > 0u);
const float DeltaAngle =
const float DeltaAngle = NumberOfLasers == 1u ? 0.f :
(Description->UpperFovLimit - Description->LowerFovLimit) /
static_cast<float>(NumberOfLasers - 1);
LaserAngles.Empty(NumberOfLasers);