mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-02 10:23:25 +08:00
AP_OSD: rangefinder: only print distance if status is good
This commit is contained in:
committed by
Andrew Tridgell
parent
ccaa5ba830
commit
f16817af89
@@ -2558,7 +2558,7 @@ void AP_OSD_Screen::draw_rngf(uint8_t x, uint8_t y)
|
||||
if (rangefinder == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (rangefinder->status_orient(ROTATION_PITCH_270) < RangeFinder::Status::Good) {
|
||||
if (rangefinder->status_orient(ROTATION_PITCH_270) != RangeFinder::Status::Good) {
|
||||
backend->write(x, y, false, "%c---%c", SYMBOL(SYM_RNGFD), u_icon(DISTANCE));
|
||||
} else {
|
||||
const float distance = rangefinder->distance_orient(ROTATION_PITCH_270);
|
||||
|
||||
Reference in New Issue
Block a user