mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 15:23:34 +08:00
CUAV CAN GPS support UAVCAN standard/indication/Button.uavcan
Co-authored-by: Daniel Agar <daniel@agar.ca>
This commit is contained in:
co-authored by
Daniel Agar
parent
5e79773275
commit
2308cb8a40
@@ -94,7 +94,12 @@ target_include_directories(uavcan_${UAVCAN_DRIVER}_driver PUBLIC
|
||||
|
||||
|
||||
# generated DSDL
|
||||
set(DSDLC_INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/dsdl/com" "${CMAKE_CURRENT_SOURCE_DIR}/dsdl/ardupilot" "${LIBUAVCAN_DIR}/dsdl/uavcan")
|
||||
set(DSDLC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dsdl")
|
||||
set(DSDLC_INPUTS
|
||||
"${DSDLC_DIR}/com"
|
||||
"${DSDLC_DIR}/standard"
|
||||
"${LIBUAVCAN_DIR}/dsdl/uavcan"
|
||||
)
|
||||
set(DSDLC_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/include/dsdlc_generated")
|
||||
|
||||
set(DSDLC_INPUT_FILES)
|
||||
|
||||
@@ -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
|
||||
@@ -63,7 +63,7 @@ void UavcanSafetyState::periodic_update(const uavcan::TimerEvent &)
|
||||
actuator_armed_s actuator_armed;
|
||||
|
||||
if (_actuator_armed_sub.update(&actuator_armed)) {
|
||||
ardupilot::indication::SafetyState cmd;
|
||||
standard::indication::SafetyState cmd;
|
||||
|
||||
if (actuator_armed.armed || actuator_armed.prearmed) {
|
||||
cmd.status = cmd.STATUS_SAFETY_OFF;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <uavcan/uavcan.hpp>
|
||||
#include <ardupilot/indication/SafetyState.hpp>
|
||||
#include <standard/indication/SafetyState.hpp>
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
/*
|
||||
* Publish CAN Safety state led
|
||||
*/
|
||||
uavcan::Publisher<ardupilot::indication::SafetyState> _safety_state_pub;
|
||||
uavcan::Publisher<standard::indication::SafetyState> _safety_state_pub;
|
||||
|
||||
uavcan::TimerEventForwarder<TimerCbBinder> _timer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user