|
|
|
@ -41,6 +41,8 @@
@@ -41,6 +41,8 @@
|
|
|
|
|
#include <ardupilot/equipment/trafficmonitor/TrafficReport.hpp> |
|
|
|
|
#include <uavcan/equipment/gnss/RTCMStream.hpp> |
|
|
|
|
|
|
|
|
|
#include<zrzk/equipment/indication/ZrRGB.hpp> |
|
|
|
|
|
|
|
|
|
#include <AP_Baro/AP_Baro_UAVCAN.h> |
|
|
|
|
#include <AP_RangeFinder/AP_RangeFinder_UAVCAN.h> |
|
|
|
|
#include <AP_GPS/AP_GPS_UAVCAN.h> |
|
|
|
@ -109,6 +111,8 @@ static uavcan::Publisher<uavcan::equipment::indication::BeepCommand>* buzzer[MAX
@@ -109,6 +111,8 @@ static uavcan::Publisher<uavcan::equipment::indication::BeepCommand>* buzzer[MAX
|
|
|
|
|
static uavcan::Publisher<ardupilot::indication::SafetyState>* safety_state[MAX_NUMBER_OF_CAN_DRIVERS]; |
|
|
|
|
static uavcan::Publisher<uavcan::equipment::gnss::RTCMStream>* rtcm_stream[MAX_NUMBER_OF_CAN_DRIVERS]; |
|
|
|
|
|
|
|
|
|
static uavcan::Publisher<zrzk::equipment::indication::ZrRGB>* zr_rgb_led[MAX_NUMBER_OF_CAN_DRIVERS]; |
|
|
|
|
|
|
|
|
|
// subscribers
|
|
|
|
|
|
|
|
|
|
// handler SafteyButton
|
|
|
|
@ -262,6 +266,12 @@ void AP_UAVCAN::init(uint8_t driver_index, bool enable_filters)
@@ -262,6 +266,12 @@ void AP_UAVCAN::init(uint8_t driver_index, bool enable_filters)
|
|
|
|
|
rtcm_stream[driver_index] = new uavcan::Publisher<uavcan::equipment::gnss::RTCMStream>(*_node); |
|
|
|
|
rtcm_stream[driver_index]->setTxTimeout(uavcan::MonotonicDuration::fromMSec(20)); |
|
|
|
|
rtcm_stream[driver_index]->setPriority(uavcan::TransferPriority::OneHigherThanLowest); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zr_rgb_led[driver_index] = new uavcan::Publisher<zrzk::equipment::indication::ZrRGB>(*_node); |
|
|
|
|
zr_rgb_led[driver_index]->setTxTimeout(uavcan::MonotonicDuration::fromMSec(20)); |
|
|
|
|
zr_rgb_led[driver_index]->setPriority(uavcan::TransferPriority::OneHigherThanLowest); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
safety_button_listener[driver_index] = new uavcan::Subscriber<ardupilot::indication::Button, ButtonCb>(*_node); |
|
|
|
|
if (safety_button_listener[driver_index]) { |
|
|
|
@ -712,4 +722,15 @@ void AP_UAVCAN::handle_traffic_report(AP_UAVCAN* ap_uavcan, uint8_t node_id, con
@@ -712,4 +722,15 @@ void AP_UAVCAN::handle_traffic_report(AP_UAVCAN* ap_uavcan, uint8_t node_id, con
|
|
|
|
|
adsb->handle_adsb_vehicle(vehicle); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool AP_UAVCAN::send_zr_rgb_led(uint8_t mode, uint8_t red, uint8_t green, uint8_t blue){ |
|
|
|
|
zrzk::equipment::indication::ZrRGB msg; |
|
|
|
|
msg.rgb_mode = mode; |
|
|
|
|
msg.rgb_r = red; |
|
|
|
|
msg.rgb_g = green; |
|
|
|
|
msg.rgb_b = blue; |
|
|
|
|
zr_rgb_led[_driver_index]->broadcast(msg); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HAL_WITH_UAVCAN
|
|
|
|
|