mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
LidarLitePWM: refactor static cast and comment
This commit is contained in:
1 parent
5010b01e2e
commit
d5c9ea048e
1 file changed
+1
-1
@@ -109,7 +109,7 @@ LidarLitePWM::measure()
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
const float current_distance = float(_pwm.pulse_width) * 1e-3f; /* 10 usec = 1 cm distance for LIDAR-Lite */
|
||||
const float current_distance = static_cast<float>(_pwm.pulse_width) * 1e-3f; // 1us = 1mm distance for LIDAR-Lite
|
||||
|
||||
/* Due to a bug in older versions of the LidarLite firmware, we have to reset sensor on (distance == 0) */
|
||||
if (current_distance <= 0.0f) {
|
||||
|
||||
Reference in new issue
Block a user