mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 19:27:35 +08:00
commander: Reset nav test when vehicle is disarmed
Previously, the only way to clear a failed nav test was to reboot. This hindered testing.
This commit is contained in:
committed by
Lorenz Meier
parent
d783bc8ae1
commit
fa5010109e
@@ -2193,9 +2193,13 @@ int commander_thread_main(int argc, char *argv[])
|
||||
orb_check(estimator_status_sub, &estimator_status_updated);
|
||||
if (estimator_status_updated) {
|
||||
orb_copy(ORB_ID(estimator_status), estimator_status_sub, &estimator_status);
|
||||
|
||||
// record time of takeoff
|
||||
if (land_detector.landed) {
|
||||
if (status.arming_state == vehicle_status_s::ARMING_STATE_STANDBY) {
|
||||
// reset flags and timer
|
||||
time_at_takeoff = hrt_absolute_time();
|
||||
nav_test_failed = false;
|
||||
nav_test_passed = false;
|
||||
} else if (land_detector.landed) {
|
||||
// record time of takeoff
|
||||
time_at_takeoff = hrt_absolute_time();
|
||||
} else {
|
||||
// if nav status is unconfirmed, confirm yaw angle as passed after 30 seconds or achieving 5 m/s of speed
|
||||
|
||||
Reference in New Issue
Block a user