navigator: check _navigation_mode_array before run

This commit is contained in:
Daniel Agar
2020-05-08 10:31:38 -04:00
parent da186877c9
commit d53bb581c2
+2
View File
@@ -710,8 +710,10 @@ Navigator::run()
/* iterate through navigation modes and set active/inactive for each */ /* iterate through navigation modes and set active/inactive for each */
for (unsigned int i = 0; i < NAVIGATOR_MODE_ARRAY_SIZE; i++) { for (unsigned int i = 0; i < NAVIGATOR_MODE_ARRAY_SIZE; i++) {
if (_navigation_mode_array[i]) {
_navigation_mode_array[i]->run(_navigation_mode == _navigation_mode_array[i]); _navigation_mode_array[i]->run(_navigation_mode == _navigation_mode_array[i]);
} }
}
/* if nothing is running, set position setpoint triplet invalid once */ /* if nothing is running, set position setpoint triplet invalid once */
if (_navigation_mode == nullptr && !_pos_sp_triplet_published_invalid_once) { if (_navigation_mode == nullptr && !_pos_sp_triplet_published_invalid_once) {