mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +08:00
Allow quadchute from external command
This commit is contained in:
@@ -108,12 +108,13 @@ public:
|
|||||||
|
|
||||||
bool is_fixed_wing_requested();
|
bool is_fixed_wing_requested();
|
||||||
void quadchute(const char *reason);
|
void quadchute(const char *reason);
|
||||||
|
int get_transition_command() {return _transition_command;}
|
||||||
|
|
||||||
struct actuator_controls_s *get_actuators_fw_in() {return &_actuators_fw_in;}
|
struct actuator_controls_s *get_actuators_fw_in() {return &_actuators_fw_in;}
|
||||||
struct actuator_controls_s *get_actuators_mc_in() {return &_actuators_mc_in;}
|
struct actuator_controls_s *get_actuators_mc_in() {return &_actuators_mc_in;}
|
||||||
struct actuator_controls_s *get_actuators_out0() {return &_actuators_out_0;}
|
struct actuator_controls_s *get_actuators_out0() {return &_actuators_out_0;}
|
||||||
struct actuator_controls_s *get_actuators_out1() {return &_actuators_out_1;}
|
struct actuator_controls_s *get_actuators_out1() {return &_actuators_out_1;}
|
||||||
struct airspeed_validated_s *get_airspeed() {return &_airspeed_validated;}
|
struct airspeed_validated_s *get_airspeed() {return &_airspeed_validated;}
|
||||||
struct position_setpoint_triplet_s *get_pos_sp_triplet() {return &_pos_sp_triplet;}
|
struct position_setpoint_triplet_s *get_pos_sp_triplet() {return &_pos_sp_triplet;}
|
||||||
struct tecs_status_s *get_tecs_status() {return &_tecs_status;}
|
struct tecs_status_s *get_tecs_status() {return &_tecs_status;}
|
||||||
struct vehicle_attitude_s *get_att() {return &_v_att;}
|
struct vehicle_attitude_s *get_att() {return &_v_att;}
|
||||||
|
|||||||
@@ -235,6 +235,17 @@ bool VtolType::can_transition_on_ground()
|
|||||||
|
|
||||||
void VtolType::check_quadchute_condition()
|
void VtolType::check_quadchute_condition()
|
||||||
{
|
{
|
||||||
|
//TODO: adapt https://mavlink.io/en/messages/common.html#MAV_VTOL_STATE to contain MAV_VTOL_STATE_QC
|
||||||
|
//instead of hardcoded 5.
|
||||||
|
if (_attc->get_transition_command() == 5 && !_quadchute_command_treated) {
|
||||||
|
_attc->quadchute("QuadChute by command");
|
||||||
|
_quadchute_command_treated = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_quadchute_command_treated = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!_tecs_running) {
|
if (!_tecs_running) {
|
||||||
// reset the filtered height rate and heigh rate setpoint if TECS is not running
|
// reset the filtered height rate and heigh rate setpoint if TECS is not running
|
||||||
|
|||||||
@@ -247,6 +247,8 @@ protected:
|
|||||||
|
|
||||||
float _accel_to_pitch_integ = 0;
|
float _accel_to_pitch_integ = 0;
|
||||||
|
|
||||||
|
bool _quadchute_command_treated = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user