mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 17:38:53 +08:00
mc_pos_control: correctly initialize landed state
Since orb_copy is guarded with a orb_check, we ended up not having the corrent landed state in the beginning which could lead to some unexpected behaviour on takeoff.
This commit is contained in:
@@ -1244,6 +1244,9 @@ MulticopterPositionControl::task_main()
|
||||
/* get an initial update for all sensor and status data */
|
||||
poll_subscriptions();
|
||||
|
||||
/* We really need to know from the beginning if we're landed or in-air. */
|
||||
orb_copy(ORB_ID(vehicle_land_detected), _vehicle_land_detected_sub, &_vehicle_land_detected);
|
||||
|
||||
bool reset_int_z = true;
|
||||
bool reset_int_z_manual = false;
|
||||
bool reset_int_xy = true;
|
||||
|
||||
Reference in New Issue
Block a user