PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

Geofence: add GF_ENFORCE

Open benjinne opened this issue 3 years ago • 1 comments

Describe problem solved by this pull request

This adds the GF_ENFORCE parameter to prevent operators from overriding GF_ACTION outside the geofence.

Describe your solution

This passes the GF_ENFORCE param accessible in the navigator via the geofence_result to the commander. This also adds a field to vehicle_status to indicate when the geofence_enforce is enabled to prevent the commander from switching modes. This is accomplished by preventing the the commander's main_state_transition from switching modes when gf_enforced is set in the vehicle_status

Describe possible alternatives

This will need to be adapted to https://github.com/PX4/PX4-Autopilot/pull/20172 or I can update that PR to add these changes

Test data / coverage

Tested with sitl setting hold and return modes and attempting to switch modes outside the geofence rejects flight mode changes.

benjinne avatar Sep 06 '22 20:09 benjinne

If you want to adapt it to my PR, you can set the allow_user_takeover flag here: https://github.com/PX4/PX4-Autopilot/pull/20172/files#diff-4e0d2266483181156b1453ad90607d7be8960912784da7c7647d0f429992701cR109

bkueng avatar Sep 07 '22 07:09 bkueng