From 39f4f7c208a0e336ada21e380704c63ae35ee290 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 31 Aug 2019 14:49:21 +1000 Subject: [PATCH] AP_UAVCAN: added safety LED and button messages --- libraries/AP_UAVCAN/dsdl/ardupilot/README.md | 8 ++++++++ .../ardupilot/indication/20000.SafetyState.uavcan | 7 +++++++ .../dsdl/ardupilot/indication/20001.Button.uavcan | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 libraries/AP_UAVCAN/dsdl/ardupilot/README.md create mode 100644 libraries/AP_UAVCAN/dsdl/ardupilot/indication/20000.SafetyState.uavcan create mode 100644 libraries/AP_UAVCAN/dsdl/ardupilot/indication/20001.Button.uavcan diff --git a/libraries/AP_UAVCAN/dsdl/ardupilot/README.md b/libraries/AP_UAVCAN/dsdl/ardupilot/README.md new file mode 100644 index 0000000000..d3eeb376da --- /dev/null +++ b/libraries/AP_UAVCAN/dsdl/ardupilot/README.md @@ -0,0 +1,8 @@ +This directory contains the DSDL for the ArduPilot vendor specific +UAVCAN messages. + +For service messages we use IDs starting at 200 + +For non-service messages we use IDs starting at 20000 + +https://uavcan.org/Specification/5._Application_level_conventions/#id-distribution diff --git a/libraries/AP_UAVCAN/dsdl/ardupilot/indication/20000.SafetyState.uavcan b/libraries/AP_UAVCAN/dsdl/ardupilot/indication/20000.SafetyState.uavcan new file mode 100644 index 0000000000..e647900916 --- /dev/null +++ b/libraries/AP_UAVCAN/dsdl/ardupilot/indication/20000.SafetyState.uavcan @@ -0,0 +1,7 @@ +# +# support for Safety LED on UAVCAN + +uint8 STATUS_SAFETY_ON = 0 +uint8 STATUS_SAFETY_OFF = 255 + +uint8 status diff --git a/libraries/AP_UAVCAN/dsdl/ardupilot/indication/20001.Button.uavcan b/libraries/AP_UAVCAN/dsdl/ardupilot/indication/20001.Button.uavcan new file mode 100644 index 0000000000..879da4803f --- /dev/null +++ b/libraries/AP_UAVCAN/dsdl/ardupilot/indication/20001.Button.uavcan @@ -0,0 +1,11 @@ +# +# support for buttons on UAVCAN +# while a button is being pressed this message should be sent at 10Hz + +uint8 BUTTON_SAFETY = 1 + +uint8 button + +# number of 0.1s units the button has been pressed for. If over 255 +# then send 255 +uint8 press_time