AP_SmartRTL: give warning buffer is about to fill-up

This commit is contained in:
Henry Wurzburg 2019-10-02 11:04:40 -05:00 committed by Randy Mackay
parent 555f56a8af
commit 13e66e9f7c
2 changed files with 8 additions and 0 deletions

View File

@ -350,6 +350,13 @@ void AP_SmartRTL::run_background_cleanup()
// perform routine cleanup which removes 10 to 50 points if possible
routine_cleanup(path_points_count, path_points_completed_limit);
// warn if buffer is about to be filled
if ((path_points_count >0) && (path_points_count >= _path_points_max - 9) && (AP_HAL::millis() - _last_low_space_notify_ms > 10000)) {
gcs().send_text(MAV_SEVERITY_INFO, "SmartRTL Low on space!");
_last_low_space_notify_ms = now;
}
}
// routine cleanup is called regularly from run_background_cleanup

View File

@ -173,6 +173,7 @@ private:
uint32_t _last_position_save_ms; // the system time a position was saved to the path (used for timeout)
uint32_t _thorough_clean_request_ms;// the last system time the thorough cleanup was requested (set by thorough_cleanup method, used by background cleanup)
uint32_t _thorough_clean_complete_ms; // set to _thorough_clean_request_ms when the background thread completes the thorough cleanup
uint32_t _last_low_space_notify_ms; //last time low on SmartRTL space was notified on Mavlink. Minimum time is required before re-notification to avoid nagging.
ThoroughCleanupType _thorough_clean_type; // used by example sketch to test simplify and prune separately
// path variables