From 9c6b941ef2d9fd301e50a261c62dfc63ddeecf3b Mon Sep 17 00:00:00 2001 From: Joshua Henderson Date: Thu, 28 Jul 2022 04:42:22 -0400 Subject: [PATCH] AP_Vehicle: add OpenDroneID library --- libraries/AP_Vehicle/AP_Vehicle.cpp | 13 +++++++++++++ libraries/AP_Vehicle/AP_Vehicle.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/libraries/AP_Vehicle/AP_Vehicle.cpp b/libraries/AP_Vehicle/AP_Vehicle.cpp index 2b593909e9..ebec1386bf 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.cpp +++ b/libraries/AP_Vehicle/AP_Vehicle.cpp @@ -75,6 +75,12 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = { AP_SUBGROUPINFO(airspeed, "ARSPD", 10, AP_Vehicle, AP_Airspeed), #endif +#if AP_OPENDRONEID_ENABLED + // @Group: DID_ + // @Path: ../AP_OpenDroneID/AP_OpenDroneID.cpp + AP_SUBGROUPINFO(opendroneid, "DID_", 15, AP_Vehicle, AP_OpenDroneID), +#endif + AP_GROUPEND }; @@ -201,6 +207,10 @@ void AP_Vehicle::setup() generator.init(); #endif +#if AP_OPENDRONEID_ENABLED + opendroneid.init(); +#endif + // init EFI monitoring #if HAL_EFI_ENABLED efi.init(); @@ -295,6 +305,9 @@ const AP_Scheduler::Task AP_Vehicle::scheduler_tasks[] = { #if HAL_GENERATOR_ENABLED SCHED_TASK_CLASS(AP_Generator, &vehicle.generator, update, 10, 50, 235), #endif +#if AP_OPENDRONEID_ENABLED + SCHED_TASK_CLASS(AP_OpenDroneID, &vehicle.opendroneid, update, 10, 50, 236), +#endif #if OSD_ENABLED SCHED_TASK(publish_osd_info, 1, 10, 240), #endif diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index aabcdab445..4e8d9fc732 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -38,6 +38,7 @@ #include // Serial manager library #include #include +#include #include #include #include @@ -354,6 +355,10 @@ protected: AP_ESC_Telem esc_telem; #endif +#if AP_OPENDRONEID_ENABLED + AP_OpenDroneID opendroneid; +#endif + #if HAL_MSP_ENABLED AP_MSP msp; #endif