Browse Source

consider transition command for the correct state

sbg
Andreas Antener 9 years ago
parent
commit
5b8b445425
  1. 2
      src/lib/ecl
  2. 12
      src/modules/vtol_att_control/vtol_att_control_main.cpp
  3. 1
      src/modules/vtol_att_control/vtol_att_control_main.h

2
src/lib/ecl

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit b21a49b3f9b7267663fd79a92f50c2db78eae762
Subproject commit 0a9f7e58dbb5708fc894a865376ede6cbb675fd4

12
src/modules/vtol_att_control/vtol_att_control_main.cpp

@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
* @author Thomas Gubler <thomasgubler@gmail.com>
* @author David Vorsin <davidvorsin@gmail.com>
* @author Sander Smeets <sander@droneslab.com>
* @author Andreas Antener <andreas@uaventure.com>
*
*/
#include "vtol_att_control_main.h"
@ -428,13 +429,14 @@ VtolAttitudeControl::is_fixed_wing_requested() @@ -428,13 +429,14 @@ VtolAttitudeControl::is_fixed_wing_requested()
{
bool to_fw = _manual_control_sp.aux1 > 0.0f;
if (_v_control_mode.flag_control_offboard_enabled || _v_control_mode.flag_control_auto_enabled) {
// listen to transition commands if not in manual
if (!_v_control_mode.flag_control_manual_enabled) {
to_fw = _transition_command == vehicle_status_s::VEHICLE_VTOL_STATE_FW;
}
// handle abort request
if(_abort_front_transition) {
if(to_fw) {
if (_abort_front_transition) {
if (to_fw) {
to_fw = false;
} else {
// the state changed to mc mode, reset the abort request
@ -666,8 +668,8 @@ void VtolAttitudeControl::task_main() @@ -666,8 +668,8 @@ void VtolAttitudeControl::task_main()
// update the vtol state machine which decides which mode we are in
_vtol_type->update_vtol_state();
// reset transition command if not in offboard control
if (!_v_control_mode.flag_control_offboard_enabled) {
// reset transition command if not auto control
if (_v_control_mode.flag_control_manual_enabled) {
if (_vtol_type->get_mode() == ROTARY_WING) {
_transition_command = vehicle_status_s::VEHICLE_VTOL_STATE_MC;

1
src/modules/vtol_att_control/vtol_att_control_main.h

@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
* @author Thomas Gubler <thomasgubler@gmail.com>
* @author David Vorsin <davidvorsin@gmail.com>
* @author Sander Smeets <sander@droneslab.com>
* @author Andreas Antener <andreas@uaventure.com>
*
*/
#ifndef VTOL_ATT_CONTROL_MAIN_H

Loading…
Cancel
Save