diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 89738d9cae..792e501534 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -425,9 +425,11 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { AP_SUBGROUPINFO(afs, "AFS_", 5, ParametersG2, AP_AdvancedFailsafe), #endif +#if AP_BEACON_ENABLED // @Group: BCN // @Path: ../libraries/AP_Beacon/AP_Beacon.cpp AP_SUBGROUPINFO(beacon, "BCN", 6, ParametersG2, AP_Beacon), +#endif // 7 was used by AP_VisualOdometry @@ -730,7 +732,9 @@ ParametersG2::ParametersG2(void) #if ADVANCED_FAILSAFE == ENABLED afs(), #endif +#if AP_BEACON_ENABLED beacon(), +#endif motors(rover.ServoRelayEvents, wheel_rate_control), wheel_rate_control(wheel_encoder), attitude_control(), diff --git a/Rover/Parameters.h b/Rover/Parameters.h index 83f718b91e..3c3040ce53 100644 --- a/Rover/Parameters.h +++ b/Rover/Parameters.h @@ -312,7 +312,9 @@ public: AP_AdvancedFailsafe_Rover afs; #endif +#if AP_BEACON_ENABLED AP_Beacon beacon; +#endif // Motor library AP_MotorsUGV motors; diff --git a/Rover/Rover.cpp b/Rover/Rover.cpp index f264315234..2ef70f1c9e 100644 --- a/Rover/Rover.cpp +++ b/Rover/Rover.cpp @@ -80,7 +80,9 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = { SCHED_TASK(set_servos, 400, 200, 15), SCHED_TASK_CLASS(AP_GPS, &rover.gps, update, 50, 300, 18), SCHED_TASK_CLASS(AP_Baro, &rover.barometer, update, 10, 200, 21), +#if AP_BEACON_ENABLED SCHED_TASK_CLASS(AP_Beacon, &rover.g2.beacon, update, 50, 200, 24), +#endif #if HAL_PROXIMITY_ENABLED SCHED_TASK_CLASS(AP_Proximity, &rover.g2.proximity, update, 50, 200, 27), #endif @@ -377,7 +379,9 @@ void Rover::update_logging1(void) if (should_log(MASK_LOG_THR)) { Log_Write_Throttle(); +#if AP_BEACON_ENABLED g2.beacon.log(); +#endif } if (should_log(MASK_LOG_NTUN)) { diff --git a/Rover/system.cpp b/Rover/system.cpp index 78e4107254..bd6ed6b1cc 100644 --- a/Rover/system.cpp +++ b/Rover/system.cpp @@ -75,8 +75,10 @@ void Rover::init_ardupilot() g2.proximity.init(); #endif +#if AP_BEACON_ENABLED // init beacons used for non-gps position estimation g2.beacon.init(); +#endif // and baro for EKF barometer.set_log_baro_bit(MASK_LOG_IMU);