From 572d9ba43b383bb9c2ce740e2546977bbaff68bb Mon Sep 17 00:00:00 2001 From: Daniel Widmann Date: Wed, 11 Apr 2018 12:48:25 -0700 Subject: [PATCH] Rover: Allow switching to ACRO mode for skid steer rovers without GPS --- APMrover2/mode.h | 4 ++-- APMrover2/mode_acro.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/APMrover2/mode.h b/APMrover2/mode.h index ff3c5b6e9d..d938ecea9a 100644 --- a/APMrover2/mode.h +++ b/APMrover2/mode.h @@ -176,9 +176,9 @@ public: // attributes for mavlink system status reporting bool has_manual_input() const override { return true; } - // acro mode requires a velocity estimate + // acro mode requires a velocity estimate for non skid-steer rovers bool requires_position() const override { return false; } - bool requires_velocity() const override { return true; } + bool requires_velocity() const override; }; diff --git a/APMrover2/mode_acro.cpp b/APMrover2/mode_acro.cpp index c92fc3ce7e..290a20ec69 100644 --- a/APMrover2/mode_acro.cpp +++ b/APMrover2/mode_acro.cpp @@ -41,3 +41,8 @@ void ModeAcro::update() calc_throttle(target_speed, false); } } + +bool ModeAcro::requires_velocity() const +{ + return g2.motors.have_skid_steering()? false: true; +}