Browse Source

Allow quadchute from external command

release/1.12
Thomas 4 years ago committed by Roman Bapst
parent
commit
d3ddbe8db5
  1. 1
      src/modules/vtol_att_control/vtol_att_control_main.h
  2. 11
      src/modules/vtol_att_control/vtol_type.cpp
  3. 2
      src/modules/vtol_att_control/vtol_type.h

1
src/modules/vtol_att_control/vtol_att_control_main.h

@ -108,6 +108,7 @@ public: @@ -108,6 +108,7 @@ public:
bool is_fixed_wing_requested();
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_mc_in() {return &_actuators_mc_in;}

11
src/modules/vtol_att_control/vtol_type.cpp

@ -235,6 +235,17 @@ bool VtolType::can_transition_on_ground() @@ -235,6 +235,17 @@ bool VtolType::can_transition_on_ground()
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) {
// reset the filtered height rate and heigh rate setpoint if TECS is not running

2
src/modules/vtol_att_control/vtol_type.h

@ -247,6 +247,8 @@ protected: @@ -247,6 +247,8 @@ protected:
float _accel_to_pitch_integ = 0;
bool _quadchute_command_treated = 0;
/**

Loading…
Cancel
Save