Browse Source

update Quadchute trigger from mavlink PR 1569

release/1.12
Thomas 4 years ago committed by Roman Bapst
parent
commit
ab10e68a40
  1. 1
      msg/vtol_vehicle_status.msg
  2. 1
      src/modules/vtol_att_control/vtol_att_control_main.cpp
  3. 3
      src/modules/vtol_att_control/vtol_att_control_main.h
  4. 8
      src/modules/vtol_att_control/vtol_type.cpp
  5. 1
      src/modules/vtol_att_control/vtol_type.h

1
msg/vtol_vehicle_status.msg

@ -4,7 +4,6 @@ uint8 VEHICLE_VTOL_STATE_TRANSITION_TO_FW = 1 @@ -4,7 +4,6 @@ uint8 VEHICLE_VTOL_STATE_TRANSITION_TO_FW = 1
uint8 VEHICLE_VTOL_STATE_TRANSITION_TO_MC = 2
uint8 VEHICLE_VTOL_STATE_MC = 3
uint8 VEHICLE_VTOL_STATE_FW = 4
uint8 VEHICLE_VTOL_STATE_QC = 5
uint64 timestamp # time since system start (microseconds)

1
src/modules/vtol_att_control/vtol_att_control_main.cpp

@ -160,6 +160,7 @@ void VtolAttitudeControl::vehicle_cmd_poll() @@ -160,6 +160,7 @@ void VtolAttitudeControl::vehicle_cmd_poll()
} else {
_transition_command = int(vehicle_command.param1 + 0.5f);
_immediate_transition = int(vehicle_command.param2 + 0.5f);
}
if (vehicle_command.from_external) {

3
src/modules/vtol_att_control/vtol_att_control_main.h

@ -109,6 +109,8 @@ public: @@ -109,6 +109,8 @@ public:
bool is_fixed_wing_requested();
void quadchute(const char *reason);
int get_transition_command() {return _transition_command;}
bool get_immediate_transition() {return _immediate_transition;}
void reset_immediate_transition() {_immediate_transition = false;}
struct actuator_controls_s *get_actuators_fw_in() {return &_actuators_fw_in;}
struct actuator_controls_s *get_actuators_mc_in() {return &_actuators_mc_in;}
@ -222,6 +224,7 @@ private: @@ -222,6 +224,7 @@ private:
* for fixed wings we want to have an idle speed of zero since we do not want
* to waste energy when gliding. */
int _transition_command{vtol_vehicle_status_s::VEHICLE_VTOL_STATE_MC};
bool _immediate_transition{false};
VtolType *_vtol_type{nullptr}; // base class for different vtol types

8
src/modules/vtol_att_control/vtol_type.cpp

@ -235,16 +235,16 @@ bool VtolType::can_transition_on_ground() @@ -235,16 +235,16 @@ bool VtolType::can_transition_on_ground()
void VtolType::check_quadchute_condition()
{
if (_attc->get_transition_command() == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_QC && !_quadchute_command_treated) {
_attc->quadchute("QuadChute by command");
if (_attc->get_transition_command() == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_MC && _attc->get_immediate_transition()
&& !_quadchute_command_treated) {
_attc->quadchute("QuadChute by external command");
_quadchute_command_treated = true;
_attc->reset_immediate_transition();
} else {
_quadchute_command_treated = false;
}
if (!_tecs_running) {
// reset the filtered height rate and heigh rate setpoint if TECS is not running
_ra_hrate = 0.0f;

1
src/modules/vtol_att_control/vtol_type.h

@ -250,7 +250,6 @@ protected: @@ -250,7 +250,6 @@ protected:
bool _quadchute_command_treated = 0;
/**
* @brief Sets mc motor minimum pwm to VT_IDLE_PWM_MC which ensures
* that they are spinning in mc mode.

Loading…
Cancel
Save