ardupilot
ardupilot copied to clipboard
AP_DroneCAN: send arming state on-change
This changes when we send DroneCAN packets ardupilot_indication_SafetyState and uavcan_equipment_safety_ArmingStatus. Existing behavior is 2Hz but this means that when we start sending esc/servo-out commands (at 50Hz) there's a lag of <=500ms between a remote device allowing those commands to be used. This messes up ramps and slews.. especially on ESCs at a takeoff event.
New behavior of when to send packets:
- steady-state 2Hz
- on-change immediately (if <=2ms ago)
- on-change 10Hz for 1000ms
Send arm/safety_state at 1Hz or if the arming/safety_state changes (which is when it gets cached).
Can we keep the 2Hz behavior? I'm worried about missed messages off the bus. I would hate for any device that requires a 1Hz heartbeat of this to suddenly risk dieing.
But otherwise I'm quite happy to have the message sent on change, and I think that's a good feature.
This needs testing before it merges
@magicrub you've stated that this needs testing before merge. Have you tested this now?
Also related: https://github.com/ArduPilot/ardupilot/pull/20872 - can Periph really stay armed indefinitely if the autopilot goes away?