Skip to content
Snippets Groups Projects
Commit e0af2912 authored by Beat Küng's avatar Beat Küng
Browse files

navigator: avoid use of a static variable last_geofence_check

parent 320bdc64
No related branches found
No related tags found
No related merge requests found
......@@ -232,6 +232,8 @@ Navigator::run()
/* rate-limit position subscription to 20 Hz / 50 ms */
orb_set_interval(_local_pos_sub, 50);
hrt_abstime last_geofence_check = 0;
while (!should_exit()) {
/* wait for up to 1000ms for data */
......@@ -552,8 +554,6 @@ Navigator::run()
check_traffic();
/* Check geofence violation */
static hrt_abstime last_geofence_check = 0;
if (have_geofence_position_data &&
(_geofence.getGeofenceAction() != geofence_result_s::GF_ACTION_NONE) &&
(hrt_elapsed_time(&last_geofence_check) > GEOFENCE_CHECK_INTERVAL)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment