|
From: | Jochen Rieger |
Subject: | Re: [Paparazzi-devel] Failsafe setting |
Date: | Thu, 22 Dec 2011 12:56:05 +0100 |
I think i believe how i can solve my problem. Theoretically. But practical, I get some errors.
I want to define an additional mode to channel 5.
Autopilot.h:
#define TRESHOLD_MANUAL_PPRZ (MIN_PPRZ / 2)
#define TRESHOLD1 TRESHOLD_MANUAL_PPRZ
#define TRESHOLD2 (MAX_PPRZ/2)
#define TRESHOLD3 (MIN_PPRZ - TRESHOLD1)
// My additional mode should set if the value is around -5600
#define TRESHOLD4 (MIN_PPRZ - (TRESHOLD1 / 2) )
#define PPRZ_MODE_OF_PULSE(pprz, mega8_status) \
(pprz > TRESHOLD2 ? PPRZ_MODE_AUTO1 : \
( ( (pprz > TRESHOLD1) ?? (pprz < TRESHOLD2) ) ? PPRZ_MODE_AUTO2 : \
( ( (pprz < TRESHOLD3) ?? (pprz > TRESHOLD4) ) ? PPRZ_MODE_HOME : PPRZ_MODE_MANUAL)))
While compile, the follow mistake appears:
In file included from firmwares/fixedwing/main_fbw.c:43:
./firmwares/fixedwing/autopilot.h: In function 'autopilot_process_radio_control':
./firmwares/fixedwing/autopilot.h:110: error: expected _expression_ before '?' token
./firmwares/fixedwing/autopilot.h:110: error: expected ':' before ')' token
./firmwares/fixedwing/autopilot.h:110: error: expected _expression_ before '?' token
./firmwares/fixedwing/autopilot.h:110: error: expected ':' before ')' token
Is this approach the right one and where is the mistake?
Thanks for any help.
Best regards.
Jochen
2011/12/21 Jochen Rieger <address@hidden>
Hello,
how can i set the RC-lost failsafe at mode channel 5? When channel 5 has a specific value, around 9600 us, the ap should regocnize an RC lost and set to HOME mode.
And additional, which average should be the channel 5 in the radio file?
Four modes (Manual, AUTO1, AUTO2 and Failsafe) should be detect.
Best regards.
Jochen
[Prev in Thread] | Current Thread | [Next in Thread] |