mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
HAL_PX4: if we have lost RC input then set channel 3 to 900
this allows failsafe to kick in
This commit is contained in:
parent
181f7368a3
commit
d01d754ba8
@ -88,6 +88,10 @@ void PX4RCInput::_timer_tick(void)
|
||||
bool rc_updated = false;
|
||||
if (orb_check(_rc_sub, &rc_updated) == 0 && rc_updated) {
|
||||
orb_copy(ORB_ID(input_rc), _rc_sub, &_rcin);
|
||||
_last_input = _rcin.timestamp;
|
||||
} else if (hrt_absolute_time() - _last_input > 300000) {
|
||||
// we've lost RC input, force channel 3 low
|
||||
_rcin.values[2] = 900;
|
||||
}
|
||||
perf_end(_perf_rcin);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ private:
|
||||
struct rc_input_values _rcin;
|
||||
int _rc_sub;
|
||||
uint64_t _last_read;
|
||||
uint64_t _last_input;
|
||||
bool _override_valid;
|
||||
perf_counter_t _perf_rcin;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user