AP_Vehicle: add AIS

This commit is contained in:
Iampete1 2021-08-14 22:29:21 +01:00 committed by Andrew Tridgell
parent b94e1c5027
commit 30fffb491c
2 changed files with 19 additions and 0 deletions

View File

@ -86,6 +86,12 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = {
AP_SUBGROUPINFO(esc_telem, "ESC_TLM", 12, AP_Vehicle, AP_ESC_Telem),
#endif
#if AP_AIS_ENABLED
// @Group: AIS_
// @Path: ../AP_AIS/AP_AIS.cpp
AP_SUBGROUPINFO(ais, "AIS_", 13, AP_Vehicle, AP_AIS),
#endif
AP_GROUPEND
};
@ -217,6 +223,10 @@ void AP_Vehicle::setup()
efi.init();
#endif
#if AP_AIS_ENABLED
ais.init();
#endif
custom_rotations.init();
gcs().send_text(MAV_SEVERITY_INFO, "ArduPilot Ready");
@ -307,6 +317,9 @@ const AP_Scheduler::Task AP_Vehicle::scheduler_tasks[] = {
#if HAL_INS_ACCELCAL_ENABLED
SCHED_TASK(accel_cal_update, 10, 100, 245),
#endif
#if AP_AIS_ENABLED
SCHED_TASK_CLASS(AP_AIS, &vehicle.ais, update, 5, 100, 249),
#endif
#if HAL_EFI_ENABLED
SCHED_TASK_CLASS(AP_EFI, &vehicle.efi, update, 10, 200, 250),
#endif

View File

@ -51,6 +51,7 @@
#include <AP_VideoTX/AP_SmartAudio.h>
#include <SITL/SITL.h>
#include <AP_CustomRotations/AP_CustomRotations.h>
#include <AP_AIS/AP_AIS.h>
class AP_Vehicle : public AP_HAL::HAL::Callbacks {
@ -386,6 +387,11 @@ protected:
AP_Airspeed airspeed;
#endif
#if AP_AIS_ENABLED
// Automatic Identification System - for tracking sea-going vehicles
AP_AIS ais;
#endif
static const struct AP_Param::GroupInfo var_info[];
static const struct AP_Scheduler::Task scheduler_tasks[];