Rover: tidy WATER_DEPTH send checks

This commit is contained in:
Peter Barker 2024-12-16 10:53:09 +11:00 committed by Peter Barker
parent 07edfdd323
commit 73710d888d
1 changed files with 7 additions and 2 deletions

View File

@ -199,9 +199,14 @@ void GCS_MAVLINK_Rover::send_water_depth() const
RangeFinder *rangefinder = RangeFinder::get_singleton(); RangeFinder *rangefinder = RangeFinder::get_singleton();
if (rangefinder == nullptr || !rangefinder->has_orientation(ROTATION_PITCH_270)){ if (rangefinder == nullptr) {
return; return;
} }
// depth can only be measured by a downward-facing rangefinder:
if (!rangefinder->has_orientation(ROTATION_PITCH_270)) {
return;
}
// get position // get position
const AP_AHRS &ahrs = AP::ahrs(); const AP_AHRS &ahrs = AP::ahrs();