From ee8d5d77d085d6e6aea923ff989fb1a5815623f1 Mon Sep 17 00:00:00 2001 From: Thorsten Panitz Date: Mon, 27 Aug 2018 21:55:29 +0200 Subject: [PATCH] Rover: Activation of OSD Rover: Activation of OSD --- APMrover2/Parameters.cpp | 6 ++++++ APMrover2/Parameters.h | 1 + APMrover2/Rover.h | 5 +++++ APMrover2/config.h | 5 +++++ APMrover2/make.inc | 1 + APMrover2/system.cpp | 4 ++++ APMrover2/wscript | 1 + 7 files changed, 23 insertions(+) diff --git a/APMrover2/Parameters.cpp b/APMrover2/Parameters.cpp index 773ee7eec0..a1655a1b56 100644 --- a/APMrover2/Parameters.cpp +++ b/APMrover2/Parameters.cpp @@ -413,6 +413,12 @@ const AP_Param::Info Rover::var_info[] = { // @Path: Parameters.cpp GOBJECT(g2, "", ParametersG2), +#if OSD_ENABLED == ENABLED + // @Group: OSD + // @Path: ../libraries/AP_OSD/AP_OSD.cpp + GOBJECT(osd, "OSD", AP_OSD), +#endif + AP_VAREND }; diff --git a/APMrover2/Parameters.h b/APMrover2/Parameters.h index 55e5d89d69..99bb027f59 100644 --- a/APMrover2/Parameters.h +++ b/APMrover2/Parameters.h @@ -202,6 +202,7 @@ public: k_param_barometer, k_param_notify, k_param_button, + k_param_osd, k_param_DataFlash = 253, // Logging Group diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index 5fd48f2797..802efe600d 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -79,6 +79,7 @@ #include #include #include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_SITL #include #endif @@ -204,6 +205,10 @@ private: // RSSI AP_RSSI rssi; +#if OSD_ENABLED == ENABLED + AP_OSD osd; +#endif + #if CONFIG_HAL_BOARD == HAL_BOARD_SITL SITL::SITL sitl; #endif diff --git a/APMrover2/config.h b/APMrover2/config.h index 74172d9c69..787d9ce379 100644 --- a/APMrover2/config.h +++ b/APMrover2/config.h @@ -171,3 +171,8 @@ #define DEVO_TELEM_ENABLED ENABLED #endif #endif + +#ifndef OSD_ENABLED + #define OSD_ENABLED DISABLED +#endif + diff --git a/APMrover2/make.inc b/APMrover2/make.inc index cc4ec05da5..3f7e737924 100644 --- a/APMrover2/make.inc +++ b/APMrover2/make.inc @@ -51,3 +51,4 @@ LIBRARIES += AC_Avoidance LIBRARIES += AC_AttitudeControl LIBRARIES += AP_Devo_Telem LIBRARIES += AP_Follow +LIBRARIES += AP_OSD diff --git a/APMrover2/system.cpp b/APMrover2/system.cpp index 84c0d3cd77..af03b9618d 100644 --- a/APMrover2/system.cpp +++ b/APMrover2/system.cpp @@ -78,6 +78,10 @@ void Rover::init_ardupilot() devo_telemetry.init(serial_manager); #endif +#if OSD_ENABLED == ENABLED + osd.init(); +#endif + #if LOGGING_ENABLED == ENABLED log_init(); #endif diff --git a/APMrover2/wscript b/APMrover2/wscript index a8721caa47..688537cbc7 100644 --- a/APMrover2/wscript +++ b/APMrover2/wscript @@ -25,6 +25,7 @@ def build(bld): 'AC_AttitudeControl', 'AP_Devo_Telem', 'AP_Follow', + 'AP_OSD', ], )