Skip to content

Commit

Permalink
Handle case for lidar with 1 degree resolution that goes from [-179,1…
Browse files Browse the repository at this point in the history
…80] with 360 readings (which RPLIDAR does in angle_compensate mode). Works with patched RPLIDAR driver here: allenh1/rplidar_ros#20 (#288)
  • Loading branch information
justinIRBT authored Sep 9, 2020
1 parent d8afc1b commit d9a8a86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/laser_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ karto::LaserRangeFinder * LaserAssistant::makeLaser(const double & mountingYaw)
laser->SetAngularResolution(scan_.angle_increment);

bool is_360_lidar = false;
if (std::fabs(scan_.angle_max - scan_.angle_min - 2.0 * M_PI) < 1e-1) {
if (std::fabs(scan_.angle_max - scan_.angle_min - 2.0 * M_PI) < (scan_.angle_increment - (std::numeric_limits<float>::epsilon() * 2.0f*M_PI))) {
is_360_lidar = true;
}

Expand Down

0 comments on commit d9a8a86

Please sign in to comment.