diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index b8f653de4b..0099248950 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -152,6 +152,10 @@ #include #endif +#if OSD_ENABLED == ENABLED + #include +#endif + #if ADVANCED_FAILSAFE == ENABLED # include "afs_copter.h" #endif diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index f82191ce63..82143d0f09 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -980,6 +980,12 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { AP_SUBGROUPINFO(follow, "FOLL", 27, ParametersG2, AP_Follow), #endif +#if OSD_ENABLED + // @Group: OSD + // @Path: ../libraries/AP_OSD/AP_OSD.cpp + AP_SUBGROUPINFO(osd, "OSD_", 28, ParametersG2, AP_OSD), +#endif + AP_GROUPEND }; diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index d266c68505..c3efee426a 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -585,6 +585,11 @@ public: // follow AP_Follow follow; #endif + +#if OSD_ENABLED == ENABLED + AP_OSD osd; +#endif + }; extern const AP_Param::Info var_info[]; diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 11f8c7f079..015f7fff16 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -728,3 +728,7 @@ #define DEVO_TELEM_ENABLED ENABLED #endif #endif + +#ifndef OSD_ENABLED + #define OSD_ENABLED DISABLED +#endif diff --git a/ArduCopter/make.inc b/ArduCopter/make.inc index 86fed0f9dd..9bfd1aeb9c 100644 --- a/ArduCopter/make.inc +++ b/ArduCopter/make.inc @@ -65,3 +65,4 @@ LIBRARIES += AP_Winch LIBRARIES += AP_WheelEncoder LIBRARIES += AP_Follow LIBRARIES += AP_Devo_Telem +LIBRARIES += AP_OSD diff --git a/ArduCopter/system.cpp b/ArduCopter/system.cpp index 115026e3ac..25d77df0ae 100644 --- a/ArduCopter/system.cpp +++ b/ArduCopter/system.cpp @@ -105,6 +105,10 @@ void Copter::init_ardupilot() devo_telemetry.init(serial_manager); #endif +#if OSD_ENABLED == ENABLED + g2.osd.init(); +#endif + #if LOGGING_ENABLED == ENABLED log_init(); #endif diff --git a/ArduCopter/wscript b/ArduCopter/wscript index 8663b477e4..7d703a4dad 100644 --- a/ArduCopter/wscript +++ b/ArduCopter/wscript @@ -34,6 +34,7 @@ def build(bld): 'AP_Winch', 'AP_Follow', 'AP_Devo_Telem', + 'AP_OSD', ], )