mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 02:23:34 +08:00
LidarLitePWM: refactor static cast and comment
This commit is contained in:
committed by
Silvan Fuhrer
parent
5010b01e2e
commit
d5c9ea048e
@@ -109,7 +109,7 @@ LidarLitePWM::measure()
|
|||||||
return PX4_ERROR;
|
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) */
|
/* Due to a bug in older versions of the LidarLite firmware, we have to reset sensor on (distance == 0) */
|
||||||
if (current_distance <= 0.0f) {
|
if (current_distance <= 0.0f) {
|
||||||
|
|||||||
Reference in New Issue
Block a user