PX4/Firmware — pull request #597 by hsteinhaus (2014-01-16 13:36:05+00:00)
Title: PX4IO: differentiate between failsafe and loss of signal, do not drop fa...

Changes:
- differentiate between failsafe an a complete loss of signal on IO side, not dropping failsafe frames anymore
- introduced a new status flag for failsafe, will be set if the receiver provides this explicit information (currently only implemented for SBus) - not related to throttle failsafe!
- introduced a new status flag indicating lost frames. This flag is set by SBus decoder, but also by short losses of a PPM signal (important to detect interuptions that are to short for a "failsafe" timeout)
- the new flags are used to compile and "rc_status" information by the (FMU-side) px4io driver, including a lost frame counter and flags active failsafe an rc_lost situations
- px4io driver ORB_publishes rc_status information
- added new flags and lost frame counter to "px4io status" output

Test status:
I have tested the following situations with "px4io status" (and a modified Ardupilot listening for rc_status notifications)
- disconnecting/reconnecting a PPM sum receiver -> RC_LOST timeout, lost frame counter incrementing while disconnected and preserved after reconnect
- throttle failsafe with PPM sum receiver -> not detected by px4io (as before)
- disconnecting/reconnecting of different SBus receivers -> RC_LOST timeout
- SBus without TX configured throttle FS (configured to HOLD on all channels) -> detected as RC_OK and RC_FAILSAFE, channel values as before failsafe triggered
- SBus with TX failsafe set to lower thottle channel: detected as RC_OK and RC_FAILSAFE, all channels set to "F/S" move to their configured values
- SBus disconnected -> RC_LOST timeout, lost frame counter incrementing until reconnected

Impact:
Activation of failsafe on SBus without TX-configured throttle failsafe does no longer trigger RC_LOST timeouts. Without explicit support on the autopilot layer, the SBus receiver behaves much like a throttle failsafe capable PPM receiver now. Off course the autopilot application can easily subscribe on rc_status information an trigger its failsafe mode on the appropriate flag (working with my locally modified APM).

No tests done with Spektrum so far, as I don't have any hardware.