From 30878553d6b8dc29d7c2dd881b6a134893104eb2 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sat, 16 Nov 2019 22:47:16 +0000 Subject: [PATCH] Tools: add AP_Camera to list of libraries remove dummy Camera methods from Replay add rcmapper to replay make replay a vehicle --- Tools/Replay/Replay.cpp | 8 ++++---- Tools/Replay/Replay.h | 8 ++++++-- Tools/Replay/wscript | 1 + Tools/ardupilotwaf/ardupilotwaf.py | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Tools/Replay/Replay.cpp b/Tools/Replay/Replay.cpp index e43809d135..5c8e00047f 100644 --- a/Tools/Replay/Replay.cpp +++ b/Tools/Replay/Replay.cpp @@ -132,6 +132,10 @@ void ReplayVehicle::setup(void) ins.set_hil_mode(); } +void ReplayVehicle::loop() +{ +} + Replay replay(replayvehicle); void Replay::usage(void) @@ -966,10 +970,6 @@ GCS_Dummy _gcs; #include // dummy methods to avoid linking with these libraries -AP_Camera *AP::camera() { return nullptr; } -void AP_Camera::send_feedback(mavlink_channel_t) {} -void AP_Camera::control(float, float, float, float, float, float) {} -void AP_Camera::configure(float, float, float, float, float, float, float) {} bool AP_AdvancedFailsafe::gcs_terminate(bool should_terminate, const char *reason) { return false; } AP_AdvancedFailsafe *AP::advancedfailsafe() { return nullptr; } diff --git a/Tools/Replay/Replay.h b/Tools/Replay/Replay.h index 2bcce253e6..26a44aa7e7 100644 --- a/Tools/Replay/Replay.h +++ b/Tools/Replay/Replay.h @@ -49,12 +49,16 @@ #include #include -class ReplayVehicle { +class ReplayVehicle : public AP_Vehicle { public: ReplayVehicle() { unused = -1; } - void setup(); + // HAL::Callbacks implementation. + void setup() override; + void loop() override; void load_parameters(void); + virtual bool set_mode(const uint8_t new_mode, const ModeReason reason) override { return true; } + AP_InertialSensor ins; AP_Baro barometer; AP_GPS gps; diff --git a/Tools/Replay/wscript b/Tools/Replay/wscript index a5c8d0ca13..7e8fb579ef 100644 --- a/Tools/Replay/wscript +++ b/Tools/Replay/wscript @@ -15,6 +15,7 @@ def build(bld): ap_libraries=bld.ap_common_vehicle_libraries() + [ 'AP_Beacon', 'AP_Arming', + 'AP_RCMapper', ], ) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index da95324e91..4b5d9fbcdf 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -25,6 +25,7 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [ 'AP_Baro', 'AP_BattMonitor', 'AP_BoardConfig', + 'AP_Camera', 'AP_Common', 'AP_Compass', 'AP_Declination',