mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 12:17:36 +08:00
Fixed in-air restart, now obeys the right order
This commit is contained in:
@@ -824,16 +824,6 @@ int commander_thread_main(int argc, char *argv[])
|
||||
|
||||
check_valid(diff_pres.timestamp, DIFFPRESS_TIMEOUT, true, &(status.condition_airspeed_valid), &status_changed);
|
||||
|
||||
orb_check(cmd_sub, &updated);
|
||||
|
||||
if (updated) {
|
||||
/* got command */
|
||||
orb_copy(ORB_ID(vehicle_command), cmd_sub, &cmd);
|
||||
|
||||
/* handle it */
|
||||
handle_command(&status, &safety, &control_mode, &cmd, &armed);
|
||||
}
|
||||
|
||||
/* update safety topic */
|
||||
orb_check(safety_sub, &updated);
|
||||
|
||||
@@ -1165,6 +1155,18 @@ int commander_thread_main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* handle commands last, as the system needs to be updated to handle them */
|
||||
orb_check(cmd_sub, &updated);
|
||||
|
||||
if (updated) {
|
||||
/* got command */
|
||||
orb_copy(ORB_ID(vehicle_command), cmd_sub, &cmd);
|
||||
|
||||
/* handle it */
|
||||
handle_command(&status, &safety, &control_mode, &cmd, &armed);
|
||||
}
|
||||
|
||||
/* evaluate the navigation state machine */
|
||||
transition_result_t res = check_navigation_state_machine(&status, &control_mode, &local_position);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user