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:
Julian Oes
2016-10-23 16:25:15 +02:00
committed by Lorenz Meier
parent 3a332bb11a
commit ff415a4f1d
@@ -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;