From 1b7c49b66261cd0d6ad3f1f7ddcfff4551677dcc Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Thu, 19 Dec 2019 22:59:06 +0000 Subject: [PATCH] Tracker: create generic vehicle management and move runcam to it add RCMapper and OSD to build --- AntennaTracker/Parameters.cpp | 4 ++++ AntennaTracker/Parameters.h | 4 +++- AntennaTracker/Tracker.cpp | 1 + AntennaTracker/system.cpp | 3 +++ AntennaTracker/wscript | 2 ++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/AntennaTracker/Parameters.cpp b/AntennaTracker/Parameters.cpp index f9127b36cd..79cece8e82 100644 --- a/AntennaTracker/Parameters.cpp +++ b/AntennaTracker/Parameters.cpp @@ -413,6 +413,10 @@ const AP_Param::Info Tracker::var_info[] = { // @Path: ../libraries/AP_Stats/AP_Stats.cpp GOBJECT(stats, "STAT", AP_Stats), + // @Group: + // @Path: ../libraries/AP_Vehicle/AP_Vehicle.cpp + { AP_PARAM_GROUP, "", Parameters::k_param_vehicle, (const void *)&tracker, {group_info : AP_Vehicle::var_info} }, + AP_VAREND }; diff --git a/AntennaTracker/Parameters.h b/AntennaTracker/Parameters.h index 7f448f735d..e8c11bb2e1 100644 --- a/AntennaTracker/Parameters.h +++ b/AntennaTracker/Parameters.h @@ -122,7 +122,9 @@ public: k_param_scan_speed_yaw, k_param_scan_speed_pitch, k_param_initial_mode, - k_param_disarm_pwm + k_param_disarm_pwm, + + k_param_vehicle = 257, // vehicle common block of parameters }; AP_Int16 format_version; diff --git a/AntennaTracker/Tracker.cpp b/AntennaTracker/Tracker.cpp index 69eb400793..ae5acb4a8f 100644 --- a/AntennaTracker/Tracker.cpp +++ b/AntennaTracker/Tracker.cpp @@ -176,5 +176,6 @@ Tracker::Tracker(void) } Tracker tracker; +AP_Vehicle& vehicle = tracker; AP_HAL_MAIN_CALLBACKS(&tracker); diff --git a/AntennaTracker/system.cpp b/AntennaTracker/system.cpp index bc61411caa..803d69d8b4 100644 --- a/AntennaTracker/system.cpp +++ b/AntennaTracker/system.cpp @@ -88,6 +88,9 @@ void Tracker::init_tracker() // initialise rc channels including setting mode rc().init(); + // run all the vehicle initialization routines + init_vehicle(); + // initialise servos init_servos(); diff --git a/AntennaTracker/wscript b/AntennaTracker/wscript index 7a59052dd8..14484890a8 100644 --- a/AntennaTracker/wscript +++ b/AntennaTracker/wscript @@ -10,6 +10,8 @@ def build(bld): 'AP_Beacon', 'AP_Arming', 'AP_Stats', + 'AP_RCMapper', + 'AP_OSD', ], )