docs(commander): say how a GF_CONT_ACTION of Terminate is handled

GF_CONT_ACTION has no Terminate, but the value 4 can still be set by
hand. The comments now say what happens then: commander only warns,
and Navigator passes the value on and refuses Go-to targets outside
the contingency geofence, as for every action other than None and
Warning.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: jonas <jonspero@me.com>
This commit is contained in:
jonas committed 2026-11-20 11:12:23 +01:00
1 parent 1a86ede26d
commit f5cde2cf02
2 files changed
+11 -2

No files matched your search

+4 -1
View File
@@ -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);
}
}
+7 -1
View File
@@ -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;