From 16b69e95b178b5fdf319cbf7ecb03667741c88ef Mon Sep 17 00:00:00 2001 From: "Brown.Z" Date: Wed, 23 Mar 2022 18:16:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UAVCAN=20RGB=20LED=20AP=5FNot?= =?UTF-8?q?ify:=E5=A2=9E=E5=8A=A0set=5Frgb=5Fmode=E8=99=9A=E5=87=BD?= =?UTF-8?q?=E6=95=B0,=E4=BC=A0=E5=85=A5=E7=81=AF=E6=A8=A1=E5=BC=8F;ToneAla?= =?UTF-8?q?rm=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA=E9=9F=B3=20AP=5FUAVCAN:?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=81=AF=E7=9B=B8=E5=85=B3=E7=9A=84uavcan?= =?UTF-8?q?=E5=87=BD=E6=95=B0=20APM=5FConfig:Disable=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=B2=A1=E7=94=A8=E5=88=B0=E7=9A=84=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArduCopter/APM_Config.h | 14 +- just_build.sh | 4 +- libraries/AP_Notify/AP_Notify.cpp | 13 +- libraries/AP_Notify/AP_Notify.h | 2 + libraries/AP_Notify/NotifyDevice.h | 2 + libraries/AP_Notify/RGBLed.cpp | 157 +++++++++++++++++- libraries/AP_Notify/RGBLed.h | 6 + libraries/AP_Notify/ToneAlarm.cpp | 9 +- libraries/AP_Notify/ToshibaLED_I2C.cpp | 5 + libraries/AP_Notify/ToshibaLED_I2C.h | 1 + libraries/AP_Notify/UAVCAN_RGB_LED.cpp | 26 ++- libraries/AP_Notify/UAVCAN_RGB_LED.h | 7 +- libraries/AP_UAVCAN/AP_UAVCAN.cpp | 37 +++++ libraries/AP_UAVCAN/AP_UAVCAN.h | 13 +- .../equipment/indication/30100.ZrRGB.uavcan | 4 + 15 files changed, 274 insertions(+), 26 deletions(-) create mode 100644 libraries/AP_UAVCAN/dsdl/zrzk/equipment/indication/30100.ZrRGB.uavcan diff --git a/ArduCopter/APM_Config.h b/ArduCopter/APM_Config.h index 326210e22b..b779d46ef7 100644 --- a/ArduCopter/APM_Config.h +++ b/ArduCopter/APM_Config.h @@ -13,18 +13,18 @@ //#define PARACHUTE DISABLED // disable parachute release to save 1k of flash //#define NAV_GUIDED DISABLED // disable external navigation computer ability to control vehicle through MAV_CMD_NAV_GUIDED mission commands //#define PRECISION_LANDING DISABLED // disable precision landing using companion computer or IRLock sensor -//#define BEACON_ENABLED DISABLED // disable beacon support -//#define SPRAYER_ENABLED DISABLED // disable the crop sprayer feature (two ESC controlled pumps the speed of which depends upon the vehicle's horizontal velocity) +#define BEACON_ENABLED DISABLED // disable beacon support +#define SPRAYER_ENABLED DISABLED // disable the crop sprayer feature (two ESC controlled pumps the speed of which depends upon the vehicle's horizontal velocity) //#define WINCH_ENABLED DISABLED // disable winch support -//#define GRIPPER_ENABLED DISABLED // disable gripper support +#define GRIPPER_ENABLED DISABLED // disable gripper support //#define RPM_ENABLED DISABLED // disable rotations per minute sensor support //#define STATS_ENABLED DISABLED // disable statistics support //#define MODE_ACRO_ENABLED DISABLED // disable acrobatic mode support //#define MODE_AUTO_ENABLED DISABLED // disable auto mode support //#define MODE_BRAKE_ENABLED DISABLED // disable brake mode support //#define MODE_CIRCLE_ENABLED DISABLED // disable circle mode support -//#define MODE_DRIFT_ENABLED DISABLED // disable drift mode support -//#define MODE_FLIP_ENABLED DISABLED // disable flip mode support +#define MODE_DRIFT_ENABLED DISABLED // disable drift mode support +#define MODE_FLIP_ENABLED DISABLED // disable flip mode support //#define MODE_FOLLOW_ENABLED DISABLED // disable follow mode support //#define MODE_GUIDED_ENABLED DISABLED // disable guided mode support //#define MODE_GUIDED_NOGPS_ENABLED DISABLED // disable guided/nogps mode support @@ -34,8 +34,8 @@ //#define MODE_SMARTRTL_ENABLED DISABLED // disable smartrtl mode support //#define MODE_SPORT_ENABLED DISABLED // disable sport mode support //#define MODE_SYSTEMID_ENABLED DISABLED // disable system ID mode support -//#define MODE_THROW_ENABLED DISABLED // disable throw mode support -//#define MODE_ZIGZAG_ENABLED DISABLED // disable zigzag mode support +#define MODE_THROW_ENABLED DISABLED // disable throw mode support +#define MODE_ZIGZAG_ENABLED DISABLED // disable zigzag mode support //#define OSD_ENABLED DISABLED // disable on-screen-display support //#define LANDING_GEAR_ENABLED DISABLED // disable landing gear support diff --git a/just_build.sh b/just_build.sh index 7adeb3257d..958a965610 100755 --- a/just_build.sh +++ b/just_build.sh @@ -1,2 +1,2 @@ -./waf configure --board Pixhawk4 -./waf copter \ No newline at end of file +./waf copter +cp build/Pixhawk4/bin/arducopter.apj /mnt/hgfs/firmware/编译/c415.px4 \ No newline at end of file diff --git a/libraries/AP_Notify/AP_Notify.cpp b/libraries/AP_Notify/AP_Notify.cpp index 1d4a80c984..a631525242 100644 --- a/libraries/AP_Notify/AP_Notify.cpp +++ b/libraries/AP_Notify/AP_Notify.cpp @@ -40,6 +40,8 @@ #include "ScriptingLED.h" #include "DShotLED.h" +#include + extern const AP_HAL::HAL& hal; AP_Notify *AP_Notify::_singleton; @@ -252,7 +254,7 @@ void AP_Notify::add_backends(void) } for (uint32_t i = 1; i < Notify_LED_MAX; i = i << 1) { - switch(_led_type & i) { + switch(_led_type & i) { case Notify_LED_None: break; case Notify_LED_Board: @@ -422,6 +424,15 @@ void AP_Notify::handle_led_control(const mavlink_message_t &msg) } } +void AP_Notify::set_rgb_mode(uint8_t mode) +{ + for (uint8_t i = 0; i < _num_devices; i++) { + if (_devices[i] != nullptr) { + _devices[i]->set_rgb_mode(mode); + } + } +} + // handle RGB from Scripting or AP_Periph void AP_Notify::handle_rgb(uint8_t r, uint8_t g, uint8_t b, uint8_t rate_hz) { diff --git a/libraries/AP_Notify/AP_Notify.h b/libraries/AP_Notify/AP_Notify.h index 893d4dc8a7..49b9c9f7e6 100644 --- a/libraries/AP_Notify/AP_Notify.h +++ b/libraries/AP_Notify/AP_Notify.h @@ -186,6 +186,8 @@ public: uint8_t get_buzz_volume() const { return _buzzer_volume; } uint8_t get_led_len() const { return _led_len; } int8_t get_rgb_led_brightness_percent() const; + + static void set_rgb_mode(uint8_t mode); // @Brown #if CONFIG_HAL_BOARD == HAL_BOARD_SITL HAL_Semaphore sf_window_mutex; diff --git a/libraries/AP_Notify/NotifyDevice.h b/libraries/AP_Notify/NotifyDevice.h index 6a8a4b5695..745dfa6979 100644 --- a/libraries/AP_Notify/NotifyDevice.h +++ b/libraries/AP_Notify/NotifyDevice.h @@ -30,6 +30,8 @@ public: // RGB control multiple leds independently // give RGB value for single led virtual void rgb_set_id(uint8_t r, uint8_t g, uint8_t b, uint8_t id) {} + + virtual void set_rgb_mode(uint8_t mode) {} // @Brown // this pointer is used to read the parameters relative to devices const AP_Notify *pNotify; diff --git a/libraries/AP_Notify/RGBLed.cpp b/libraries/AP_Notify/RGBLed.cpp index 9ac6a07bf6..8ba299751f 100644 --- a/libraries/AP_Notify/RGBLed.cpp +++ b/libraries/AP_Notify/RGBLed.cpp @@ -35,16 +35,25 @@ RGBLed::RGBLed(uint8_t led_off, uint8_t led_bright, uint8_t led_medium, uint8_t // set_rgb - set color as a combination of red, green and blue values void RGBLed::_set_rgb(uint8_t red, uint8_t green, uint8_t blue) { - if (red != _red_curr || - green != _green_curr || - blue != _blue_curr) { - // call the hardware update routine + if(rgb_source() == use_ws2812){ if (hw_set_rgb(red, green, blue)) { _red_curr = red; _green_curr = green; _blue_curr = blue; } + }else{ + if (red != _red_curr || + green != _green_curr || + blue != _blue_curr) { + // call the hardware update routine + if (hw_set_rgb(red, green, blue)) { + _red_curr = red; + _green_curr = green; + _blue_curr = blue; + } + } } + } RGBLed::rgb_source_t RGBLed::rgb_source() const @@ -204,6 +213,9 @@ void RGBLed::update() case traffic_light: current_colour_sequence = get_colour_sequence_traffic_light(); break; + case use_ws2812: + get_colour_ws2812(); + break; } const uint8_t brightness = get_brightness(); @@ -218,10 +230,19 @@ void RGBLed::update() const uint8_t colour = (current_colour_sequence >> (step*3)) & 7; - uint8_t red_des = (colour & RED) ? brightness : _led_off; - uint8_t green_des = (colour & GREEN) ? brightness : _led_off; - uint8_t blue_des = (colour & BLUE) ? brightness : _led_off; - + uint8_t red_des ; + uint8_t green_des ; + uint8_t blue_des; + + if(rgb_source() == use_ws2812){ + red_des = (_red_ws != _led_off) ? brightness : 0; + green_des = (_green_ws != _led_off) ? brightness : 0; + blue_des = (_blue_ws != _led_off) ? brightness : 0; + }else{ + red_des = (colour & RED) ? brightness : _led_off; + green_des = (colour & GREEN) ? brightness : _led_off; + blue_des = (colour & BLUE) ? brightness : _led_off; + } set_rgb(red_des, green_des, blue_des); } @@ -292,3 +313,123 @@ void RGBLed::rgb_control(uint8_t r, uint8_t g, uint8_t b, uint8_t rate_hz) _led_override.g = g; _led_override.b = b; } + +void RGBLed::set_rgb_mode(uint8_t mode) +{ + if (!pNotify->_rgb_led_override) { + // ignore LED_CONTROL commands if not in LED_OVERRIDE mode + return; + } +} + +void RGBLed::get_colour_ws2812(void) +{ + // initialising pattern + if (AP_Notify::flags.initialising) { + // return sequence_initialising; + _red_ws = _led_medium; + _blue_ws = _led_off; + _green_ws = _led_medium; + set_rgb_mode(1); + return; + } + + // save trim and esc calibration pattern + if (AP_Notify::flags.save_trim || AP_Notify::flags.esc_calibration) { + // return sequence_trim_or_esc; + _red_ws = _led_medium; + _blue_ws = _led_medium; + _green_ws = _led_medium; + set_rgb_mode(1); // flow + return; + } + + // radio and battery failsafe patter: flash yellow + // gps failsafe pattern : flashing yellow and blue + // ekf_bad pattern : flashing yellow and red + if (AP_Notify::flags.failsafe_radio || + AP_Notify::flags.failsafe_battery || + AP_Notify::flags.ekf_bad || + AP_Notify::flags.gps_glitching || + AP_Notify::flags.leak_detected) { + + if (AP_Notify::flags.leak_detected) { + // purple if leak detected + // return sequence_failsafe_leak; + } else if (AP_Notify::flags.ekf_bad) { + // red on if ekf bad + // return sequence_failsafe_ekf; + } else if (AP_Notify::flags.gps_glitching) { + // blue on gps glitch + // return sequence_failsafe_gps_glitching; + } + // all off for radio or battery failsafe + // return sequence_failsafe_radio_or_battery; + _red_ws = _led_medium; + _blue_ws = _led_medium; + _green_ws = _led_off; + set_rgb_mode(1); + return; + } + static uint16_t arm_delay_cnt; + // solid green or blue if armed + if (AP_Notify::flags.armed) { + // solid green if armed with GPS 3d lock + if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D) { + // return sequence_armed; + _red_ws = _led_off; + _blue_ws = _led_off; + _green_ws = _led_medium; + } + // solid blue if armed with no GPS lock + // return sequence_armed_nogps; + else{ _red_ws = _led_off; + _blue_ws = _led_medium; + _green_ws = _led_medium; + set_rgb_mode(0);} + + if(arm_delay_cnt>500){ + _red_ws = _led_off; + _blue_ws = _led_off; + _green_ws = _led_off; + set_rgb_mode(0); + }else{ + arm_delay_cnt+=1; + + } + return; + }else{ + arm_delay_cnt = 0; + } + + // double flash yellow if failing pre-arm checks + if (!AP_Notify::flags.pre_arm_check) { + // return sequence_prearm_failing; + _red_ws = _led_medium; + _blue_ws = _led_off; + _green_ws = _led_medium; + set_rgb_mode(1); + return; + } + if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D_DGPS && AP_Notify::flags.pre_arm_gps_check) { + // return sequence_disarmed_good_dgps; + _red_ws = _led_off; + _blue_ws = _led_off; + _green_ws = _led_medium; + set_rgb_mode(2); // green breath + }else if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D && AP_Notify::flags.pre_arm_gps_check) { + // return sequence_disarmed_good_gps; + _red_ws = _led_off; + _blue_ws = _led_off; + _green_ws = _led_medium; + set_rgb_mode(2); // blue green breath + }else{ + _red_ws = _led_off; + _blue_ws = _led_medium; + _green_ws = _led_medium; + set_rgb_mode(2); // blue breath + + } + + // return sequence_disarmed_bad_gps; +} \ No newline at end of file diff --git a/libraries/AP_Notify/RGBLed.h b/libraries/AP_Notify/RGBLed.h index 46dad5726f..996e7ad15c 100644 --- a/libraries/AP_Notify/RGBLed.h +++ b/libraries/AP_Notify/RGBLed.h @@ -39,6 +39,8 @@ public: // give RGB and flash rate, used with scripting virtual void rgb_control(uint8_t r, uint8_t g, uint8_t b, uint8_t rate_hz) override; + virtual void set_rgb_mode(uint8_t mode) override; // @Brown + protected: // methods implemented in hardware specific classes virtual bool hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue) = 0; @@ -60,6 +62,8 @@ protected: uint8_t rate_hz; uint32_t start_ms; } _led_override; + + uint8_t _red_ws, _green_ws, _blue_ws; // color requested by timed update, @Brown private: void update_colours(); @@ -68,6 +72,7 @@ private: uint32_t get_colour_sequence_traffic_light() const; uint8_t get_brightness(void) const; + void get_colour_ws2812(); #define DEFINE_COLOUR_SEQUENCE(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9) \ ((S0) << (0*3) | (S1) << (1*3) | (S2) << (2*3) | (S3) << (3*3) | (S4) << (4*3) | (S5) << (5*3) | (S6) << (6*3) | (S7) << (7*3) | (S8) << (8*3) | (S9) << (9*3)) @@ -108,6 +113,7 @@ private: mavlink = 1, obc = 2, traffic_light = 3, + use_ws2812 = 4 }; rgb_source_t rgb_source() const; diff --git a/libraries/AP_Notify/ToneAlarm.cpp b/libraries/AP_Notify/ToneAlarm.cpp index e2b5c4f790..27bca7c766 100644 --- a/libraries/AP_Notify/ToneAlarm.cpp +++ b/libraries/AP_Notify/ToneAlarm.cpp @@ -47,9 +47,11 @@ const AP_ToneAlarm::Tone AP_ToneAlarm::_tones[] { #define AP_NOTIFY_TONE_LOUD_POS_FEEDBACK 5 { "MFT100L4>A#B#", false }, #define AP_NOTIFY_TONE_LOUD_READY_OR_FINISHED 6 - { "MFT100L4>G#6A#6B#4", false }, + // { "MFT100L4>G#6A#6B#4", false }, + { "MFT200L4A#A#A#A#", false }, #define AP_NOTIFY_TONE_QUIET_ARMING_WARNING 9 @@ -93,7 +95,8 @@ const AP_ToneAlarm::Tone AP_ToneAlarm::_tones[] { #define AP_NOTIFY_TONE_QUIET_NOT_READY_OR_NOT_FINISHED 28 { "MFT200L4transfer(val, sizeof(val), nullptr, 0); } + +void ToshibaLED_I2C::set_rgb_mode(uint8_t mode) +{ + return; +} diff --git a/libraries/AP_Notify/ToshibaLED_I2C.h b/libraries/AP_Notify/ToshibaLED_I2C.h index 093ed018fc..4b6ab51bb8 100644 --- a/libraries/AP_Notify/ToshibaLED_I2C.h +++ b/libraries/AP_Notify/ToshibaLED_I2C.h @@ -26,6 +26,7 @@ public: bool init(void) override; protected: bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override; + void set_rgb_mode(uint8_t mode) override; private: AP_HAL::OwnPtr _dev; diff --git a/libraries/AP_Notify/UAVCAN_RGB_LED.cpp b/libraries/AP_Notify/UAVCAN_RGB_LED.cpp index 3d21c09537..6b17914f9f 100644 --- a/libraries/AP_Notify/UAVCAN_RGB_LED.cpp +++ b/libraries/AP_Notify/UAVCAN_RGB_LED.cpp @@ -19,9 +19,7 @@ #if HAL_CANMANAGER_ENABLED #include "UAVCAN_RGB_LED.h" - #include - #include #define LED_OFF 0 @@ -62,12 +60,34 @@ bool UAVCAN_RGB_LED::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue) bool success = false; uint8_t can_num_drivers = AP::can().get_num_drivers(); + static uint8_t cnt; + static uint8_t l_mode,l_red,l_green,l_blue; + rgb = {red, green, blue}; + + cnt++; + if(l_mode != rgb_mode || l_red != rgb.r || l_green != rgb.g || l_blue != rgb.b || cnt > 50) + { + cnt =0; + _need_update = true; + l_mode = rgb_mode ; + l_red = rgb.r ; + l_green = rgb.g ; + l_blue = rgb.b; + }else{ + return success; + } + for (uint8_t i = 0; i < can_num_drivers; i++) { AP_UAVCAN *uavcan = AP_UAVCAN::get_uavcan(i); if (uavcan != nullptr) { - success = uavcan->led_write(_led_index, red, green, blue) || success; + // success = uavcan->led_write(_led_index, red, green, blue) || success; + success = uavcan->set_zr_rgb_led(rgb_mode,red, green, blue) || success;//(_led_index, red, green, blue) || success } } return success; } +void UAVCAN_RGB_LED::set_rgb_mode(uint8_t mode) +{ + rgb_mode = mode; +} #endif diff --git a/libraries/AP_Notify/UAVCAN_RGB_LED.h b/libraries/AP_Notify/UAVCAN_RGB_LED.h index ddb19eee2b..18b97ed7c7 100644 --- a/libraries/AP_Notify/UAVCAN_RGB_LED.h +++ b/libraries/AP_Notify/UAVCAN_RGB_LED.h @@ -11,8 +11,13 @@ public: protected: virtual bool hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue) override; - + void set_rgb_mode(uint8_t mode) override; private: uint8_t _led_index; + uint8_t rgb_mode; + bool _need_update; + struct { + uint8_t r, g, b; + } rgb; }; diff --git a/libraries/AP_UAVCAN/AP_UAVCAN.cpp b/libraries/AP_UAVCAN/AP_UAVCAN.cpp index e162e56c9b..7bf18d5be5 100644 --- a/libraries/AP_UAVCAN/AP_UAVCAN.cpp +++ b/libraries/AP_UAVCAN/AP_UAVCAN.cpp @@ -61,6 +61,8 @@ #include #include "AP_UAVCAN_pool.h" +#include + #define LED_DELAY_US 50000 extern const AP_HAL::HAL& hal; @@ -175,6 +177,8 @@ static uavcan::ServiceClient* zr_rgb_led[HAL_MAX_CAN_PROTOCOL_DRIVERS]; + // subscribers // handler SafteyButton @@ -390,6 +394,10 @@ void AP_UAVCAN::init(uint8_t driver_index, bool enable_filters) param_get_set_client[driver_index] = new uavcan::ServiceClient(*_node, ParamGetSetCb(this, &AP_UAVCAN::handle_param_get_set_response)); param_execute_opcode_client[driver_index] = new uavcan::ServiceClient(*_node, ParamExecuteOpcodeCb(this, &AP_UAVCAN::handle_param_save_response)); + + zr_rgb_led[driver_index] = new uavcan::Publisher(*_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(*_node); if (safety_button_listener[driver_index]) { @@ -490,6 +498,7 @@ void AP_UAVCAN::loop(void) send_parameter_request(); send_parameter_save_request(); _dna_server->verify_nodes(); + zr_rgb_led_send(); } } @@ -1211,4 +1220,32 @@ bool AP_UAVCAN::prearm_check(char* fail_msg, uint8_t fail_msg_len) const return _dna_server->prearm_check(fail_msg, fail_msg_len); } +bool AP_UAVCAN::set_zr_rgb_led(uint8_t mode, uint8_t red, uint8_t green, uint8_t blue) +{ + WITH_SEMAPHORE(_zr_rgb_led.sem); + + _zr_rgb_led.mode = mode; + _zr_rgb_led.red = red; + _zr_rgb_led.green = green; + _zr_rgb_led.blue = blue; + _zr_rgb_led.need_send = true; + return true; +} +void AP_UAVCAN::zr_rgb_led_send() +{ + if(!_zr_rgb_led.need_send) + { + return; + } + + zrzk::equipment::indication::ZrRGB msg; + WITH_SEMAPHORE(_zr_rgb_led.sem); + + msg.rgb_mode = _zr_rgb_led.mode; + msg.rgb_r =_zr_rgb_led. red; + msg.rgb_g = _zr_rgb_led.green; + msg.rgb_b = _zr_rgb_led.blue; + zr_rgb_led[_driver_index]->broadcast(msg); + _zr_rgb_led.need_send =false; +} #endif // HAL_NUM_CAN_IFACES diff --git a/libraries/AP_UAVCAN/AP_UAVCAN.h b/libraries/AP_UAVCAN/AP_UAVCAN.h index 2523bc54ed..6fa1f5ed8a 100644 --- a/libraries/AP_UAVCAN/AP_UAVCAN.h +++ b/libraries/AP_UAVCAN/AP_UAVCAN.h @@ -130,6 +130,8 @@ public: // send RTCMStream packets void send_RTCMStream(const uint8_t *data, uint32_t len); + + bool set_zr_rgb_led(uint8_t mode, uint8_t red, uint8_t green, uint8_t blue); // Send Reboot command // Note: Do not call this from outside UAVCAN thread context, @@ -330,7 +332,15 @@ private: // notify vehicle state uint32_t _last_notify_state_ms; - + struct + { + HAL_Semaphore sem; + uint8_t mode; + uint8_t red; + uint8_t green; + uint8_t blue; + bool need_send; + } _zr_rgb_led; // incoming button handling static void handle_button(AP_UAVCAN* ap_uavcan, uint8_t node_id, const ButtonCb &cb); static void handle_traffic_report(AP_UAVCAN* ap_uavcan, uint8_t node_id, const TrafficReportCb &cb); @@ -340,6 +350,7 @@ private: static void handle_debug(AP_UAVCAN* ap_uavcan, uint8_t node_id, const DebugCb &cb); static void handle_param_get_set_response(AP_UAVCAN* ap_uavcan, uint8_t node_id, const ParamGetSetCb &cb); static void handle_param_save_response(AP_UAVCAN* ap_uavcan, uint8_t node_id, const ParamExecuteOpcodeCb &cb); + void zr_rgb_led_send(); }; #endif // #if HAL_ENABLE_LIBUAVCAN_DRIVERS diff --git a/libraries/AP_UAVCAN/dsdl/zrzk/equipment/indication/30100.ZrRGB.uavcan b/libraries/AP_UAVCAN/dsdl/zrzk/equipment/indication/30100.ZrRGB.uavcan new file mode 100644 index 0000000000..30341327e1 --- /dev/null +++ b/libraries/AP_UAVCAN/dsdl/zrzk/equipment/indication/30100.ZrRGB.uavcan @@ -0,0 +1,4 @@ +uint8 rgb_mode # RGBLED mode +uint8 rgb_r # brightness of red light +uint8 rgb_g # brightness of red green +uint8 rgb_b # brightness of red blue