Browse Source

commander: flight termination, require arming

sbg
Thomas Gubler 11 years ago
parent
commit
2971510289
  1. 4
      src/modules/commander/commander.cpp

4
src/modules/commander/commander.cpp

@ -1311,7 +1311,7 @@ int commander_thread_main(int argc, char *argv[]) @@ -1311,7 +1311,7 @@ int commander_thread_main(int argc, char *argv[])
orb_copy(ORB_ID(position_setpoint_triplet), pos_sp_triplet_sub, &pos_sp_triplet);
/* Check for geofence violation */
if (pos_sp_triplet.geofence_violated || pos_sp_triplet.flight_termination) {
if (armed.armed && (pos_sp_triplet.geofence_violated || pos_sp_triplet.flight_termination)) {
//XXX: make this configurable to select different actions (e.g. navigation modes)
/* this will only trigger if geofence is activated via param and a geofence file is present, also there is a circuit breaker to disable the actual flight termination in the px4io driver */
armed.force_failsafe = true;
@ -1580,6 +1580,7 @@ int commander_thread_main(int argc, char *argv[]) @@ -1580,6 +1580,7 @@ int commander_thread_main(int argc, char *argv[])
}
/* Check for failure combinations which lead to flight termination */
if (armed.armed) {
/* At this point the data link and the gps system have been checked
* If both failed we want to terminate the flight */
if ((status.data_link_lost && status.gps_failure) ||
@ -1604,6 +1605,7 @@ int commander_thread_main(int argc, char *argv[]) @@ -1604,6 +1605,7 @@ int commander_thread_main(int argc, char *argv[])
warnx("Flight termination because of RC signal loss && gps failure");
mavlink_log_critical(mavlink_fd, "RC and GPS lost: flight termination");
}
}
hrt_abstime t1 = hrt_absolute_time();

Loading…
Cancel
Save