diff --git a/src/modules/commander/failsafe/failsafe.cpp b/src/modules/commander/failsafe/failsafe.cpp index b4fdd110001..f03da080950 100644 --- a/src/modules/commander/failsafe/failsafe.cpp +++ b/src/modules/commander/failsafe/failsafe.cpp @@ -132,6 +132,9 @@ FailsafeBase::ActionOptions Failsafe::fromGfActParam(int param_value) return options; } +// GF_CONT_ACTION offers the actions of GF_ACTION without Terminate (4): the vehicle is expected to reach the +// contingency geofence, so terminating there is too dangerous. Terminate stays with GF_ACTION. +// A 4 set by hand does not terminate: like every value that is not offered, it only warns. FailsafeBase::ActionOptions Failsafe::fromGfContActParam(int param_value) { switch (geofence_violation_action(param_value)) { @@ -142,7 +145,7 @@ FailsafeBase::ActionOptions Failsafe::fromGfContActParam(int param_value) return fromGfActParam(param_value); default: - // The contingency geofence does not offer Terminate. + // Warning, Terminate and unknown values. return ActionOptions(Action::Warn); } } diff --git a/src/modules/navigator/geofence.h b/src/modules/navigator/geofence.h index 8f7be547d4c..8ec24d2e991 100644 --- a/src/modules/navigator/geofence.h +++ b/src/modules/navigator/geofence.h @@ -224,7 +224,13 @@ public: int getSource() { return _param_gf_source.get(); } int getGeofenceAction() { return _param_gf_action.get(); } - /** GF_CONT_ACTION, or None while the contingency geofence is disabled. */ + /** + * GF_CONT_ACTION, or None while the contingency geofence is disabled. + * The value is passed on as set. Commander decides what a breach triggers and turns a value the parameter + * does not offer into a Warning, see Failsafe::fromGfContActParam(). Example: a 4 (Terminate) set by hand + * only warns. Navigator still refuses Go-to targets outside the contingency geofence with such a value, + * as it does for every action other than None and Warning. + */ int getContGeofenceAction() const { return getContGeofenceMargin() > FLT_EPSILON ? _param_gf_cont_action.get() : geofence_result_s::GF_ACTION_NONE;