mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Prevent an alarm from ManualControlCommand when using autotuning mode.
This commit is contained in:
parent
50c7641162
commit
fc2f8376bc
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "manualcontrolcommand.h"
|
#include "manualcontrolcommand.h"
|
||||||
|
|
||||||
typedef enum {FLIGHTMODE_UNDEFINED = 0, FLIGHTMODE_MANUAL = 1, FLIGHTMODE_STABILIZED = 2, FLIGHTMODE_GUIDANCE = 3} flightmode_path;
|
typedef enum {FLIGHTMODE_UNDEFINED = 0, FLIGHTMODE_MANUAL = 1, FLIGHTMODE_STABILIZED = 2, FLIGHTMODE_GUIDANCE = 3, FLIGHTMODE_TUNING = 4} flightmode_path;
|
||||||
|
|
||||||
#define PARSE_FLIGHT_MODE(x) ( \
|
#define PARSE_FLIGHT_MODE(x) ( \
|
||||||
(x == FLIGHTSTATUS_FLIGHTMODE_MANUAL) ? FLIGHTMODE_MANUAL : \
|
(x == FLIGHTSTATUS_FLIGHTMODE_MANUAL) ? FLIGHTMODE_MANUAL : \
|
||||||
@ -41,7 +41,8 @@ typedef enum {FLIGHTMODE_UNDEFINED = 0, FLIGHTMODE_MANUAL = 1, FLIGHTMODE_STABIL
|
|||||||
(x == FLIGHTSTATUS_FLIGHTMODE_STABILIZED3) ? FLIGHTMODE_STABILIZED : \
|
(x == FLIGHTSTATUS_FLIGHTMODE_STABILIZED3) ? FLIGHTMODE_STABILIZED : \
|
||||||
(x == FLIGHTSTATUS_FLIGHTMODE_ALTITUDEHOLD) ? FLIGHTMODE_GUIDANCE : \
|
(x == FLIGHTSTATUS_FLIGHTMODE_ALTITUDEHOLD) ? FLIGHTMODE_GUIDANCE : \
|
||||||
(x == FLIGHTSTATUS_FLIGHTMODE_VELOCITYCONTROL) ? FLIGHTMODE_GUIDANCE : \
|
(x == FLIGHTSTATUS_FLIGHTMODE_VELOCITYCONTROL) ? FLIGHTMODE_GUIDANCE : \
|
||||||
(x == FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD) ? FLIGHTMODE_GUIDANCE : FLIGHTMODE_UNDEFINED \
|
(x == FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD) ? FLIGHTMODE_GUIDANCE : \
|
||||||
|
(x == FLIGHTSTATUS_FLIGHTMODE_AUTOTUNE) ? FLIGHTMODE_TUNING : FLIGHTMODE_UNDEFINED \
|
||||||
)
|
)
|
||||||
|
|
||||||
int32_t ManualControlInitialize();
|
int32_t ManualControlInitialize();
|
||||||
|
@ -388,6 +388,10 @@ static void manualControlTask(void *parameters)
|
|||||||
case FLIGHTMODE_STABILIZED:
|
case FLIGHTMODE_STABILIZED:
|
||||||
updateStabilizationDesired(&cmd, &settings);
|
updateStabilizationDesired(&cmd, &settings);
|
||||||
break;
|
break;
|
||||||
|
case FLIGHTMODE_TUNING:
|
||||||
|
// Tuning takes settings directly from manualcontrolcommand. No need to
|
||||||
|
// call anything else. This just avoids errors.
|
||||||
|
break;
|
||||||
case FLIGHTMODE_GUIDANCE:
|
case FLIGHTMODE_GUIDANCE:
|
||||||
switch(flightStatus.FlightMode) {
|
switch(flightStatus.FlightMode) {
|
||||||
case FLIGHTSTATUS_FLIGHTMODE_ALTITUDEHOLD:
|
case FLIGHTSTATUS_FLIGHTMODE_ALTITUDEHOLD:
|
||||||
|
Loading…
Reference in New Issue
Block a user