ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_DroneCAN: send arming state on-change

Open magicrub opened this issue 2 years ago • 4 comments

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

magicrub avatar Sep 14 '23 17:09 magicrub

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.

WickedShell avatar Sep 15 '23 23:09 WickedShell

This needs testing before it merges

magicrub avatar Sep 19 '23 01:09 magicrub

@magicrub you've stated that this needs testing before merge. Have you tested this now?

peterbarker avatar Aug 10 '24 02:08 peterbarker

Also related: https://github.com/ArduPilot/ardupilot/pull/20872 - can Periph really stay armed indefinitely if the autopilot goes away?

peterbarker avatar Sep 11 '24 13:09 peterbarker