mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 08:33:34 +08:00
Set up landing gear logic for tiltrotor and tailsitter VTOL. Gear is set down when in hover mode, esle gear is set up.
This commit is contained in:
@@ -42,6 +42,8 @@
|
||||
#include "tiltrotor.h"
|
||||
#include "vtol_att_control_main.h"
|
||||
|
||||
#include <uORB/topics/landing_gear.h>
|
||||
|
||||
using namespace matrix;
|
||||
using namespace time_literals;
|
||||
|
||||
@@ -520,6 +522,14 @@ void Tiltrotor::fill_actuator_outputs()
|
||||
_thrust_setpoint_0->xyz[0] = -_thrust_setpoint_0->xyz[2] * sinf(_tilt_control * M_PI_2_F);
|
||||
}
|
||||
|
||||
// Landing gear
|
||||
if (_vtol_schedule.flight_mode == vtol_mode::MC_MODE) {
|
||||
mc_out[actuator_controls_s::INDEX_LANDING_GEAR] = landing_gear_s::GEAR_DOWN;
|
||||
|
||||
} else {
|
||||
mc_out[actuator_controls_s::INDEX_LANDING_GEAR] = landing_gear_s::GEAR_UP;
|
||||
}
|
||||
|
||||
// Fixed wing output
|
||||
fw_out[4] = _tilt_control;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user