diff --git a/libraries/AP_Vehicle/AP_Vehicle.cpp b/libraries/AP_Vehicle/AP_Vehicle.cpp index 5da1fdeeef1..ef0012d309f 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.cpp +++ b/libraries/AP_Vehicle/AP_Vehicle.cpp @@ -292,6 +292,12 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = { AP_SUBGROUPINFO(rpm_sensor, "RPM", 32, AP_Vehicle, AP_RPM), #endif +#if AP_BEACON_ENABLED + // @Group: BCN + // @Path: ../AP_Beacon/AP_Beacon.cpp + AP_SUBGROUPINFO(beacon, "BCN", 33, AP_Vehicle, AP_Beacon), +#endif // AP_BEACON_ENABLED + AP_GROUPEND }; @@ -428,6 +434,11 @@ void AP_Vehicle::setup() AP::gripper().init(); #endif + // init beacons used for non-gps position estimation +#if AP_BEACON_ENABLED + beacon.init(); +#endif // AP_BEACON_ENABLED + // init_ardupilot is where the vehicle does most of its initialisation. init_ardupilot(); @@ -621,6 +632,9 @@ const AP_Scheduler::Task AP_Vehicle::scheduler_tasks[] = { #if HAL_GYROFFT_ENABLED FAST_TASK_CLASS(AP_GyroFFT, &vehicle.gyro_fft, sample_gyros), #endif +#if AP_BEACON_ENABLED + SCHED_TASK_CLASS(AP_Beacon, &vehicle.beacon, update, 400, 200, 24), +#endif // AP_BEACON_ENABLED #if AP_AIRSPEED_ENABLED SCHED_TASK_CLASS(AP_Airspeed, &vehicle.airspeed, update, 10, 100, 41), // NOTE: the priority number here should be right before Plane's calc_airspeed_errors #endif diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index 8f215e36f68..7c161833b28 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -81,6 +81,11 @@ #include #endif +#include +#if AP_BEACON_ENABLED +#include +#endif // AP_BEACON_ENABLED + #include #if AP_RPM_ENABLED #include @@ -376,6 +381,11 @@ protected: AP_Gripper gripper; #endif +#if AP_BEACON_ENABLED + // beacon (non-GPS positioning) library + AP_Beacon beacon; +#endif // AP_BEACON_ENABLED + #if AP_IBUS_TELEM_ENABLED AP_IBus_Telem ibus_telem; #endif