Geofence: rework messaging and notification

- do reporting of breaching in-air only in geofenceCheck
- remove geofence_violation_reason_t
- replace geofence_breached field in GeofenceResult.msg with 3 fields
(one for each GF type: max dist, max alt, custom geofence)
- the warning message after breaching a GF is only done by Commander,
and it's specific to the GF type failure

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2023-11-22 21:45:02 -05:00
committed by Daniel Agar
parent 3c194d552a
commit 2865bbb8ab
10 changed files with 127 additions and 123 deletions
@@ -339,7 +339,8 @@ private:
geofence_result_s geofence;
if (_geofence_sub.update(&geofence)) {
if (geofence.primary_geofence_breached) {
if (geofence.geofence_max_dist_triggered || geofence.geofence_max_alt_triggered
|| geofence.geofence_custom_fence_triggered) {
msg->failure_flags |= HL_FAILURE_FLAG_GEOFENCE;
}