rosflight / rosflight_ros_pkgs

ROS packages for the ROSflight autopilot
http://rosflight.org/
BSD 3-Clause "New" or "Revised" License
86 stars 56 forks source link

Better rc failsafe sim #134

Open BillThePlatypus opened 4 years ago

BillThePlatypus commented 4 years ago

This changes the RC failsafe behavior when using the SIL simulation. In the old behavior, RC is never considered lost, once at least one message has been sent to the RC input. If there are no active publishers, the RC values default to centered sticks, zero throttle, and switches off. If using an arm switch, this disarms the aircraft, which also disables the failsafe behavior.

This PR changes the behavior. Now, if no RC messages are received for 1 second, the board starts acknowledging that RC is lost. Additionally, calls to rc_read return the most recent RC value instead of centering. This allows for better testing of failsafe behavior in simulation.

bsutherland333 commented 8 months ago

This would still be a useful change, it just needs to be rebased onto the ROS2 updates.