diff --git a/libraries/APM_Control/AP_SteerController.cpp b/libraries/APM_Control/AP_SteerController.cpp index cedb1e68ea..4658034c85 100644 --- a/libraries/APM_Control/AP_SteerController.cpp +++ b/libraries/APM_Control/AP_SteerController.cpp @@ -249,3 +249,9 @@ void AP_SteerController::reset_I() _pid_info.I = 0; } +// Returns true if controller has been run recently +bool AP_SteerController::active() const +{ + return (AP_HAL::millis() - _last_t) < 1000; +} + diff --git a/libraries/APM_Control/AP_SteerController.h b/libraries/APM_Control/AP_SteerController.h index 301919f3a5..71633c9bef 100644 --- a/libraries/APM_Control/AP_SteerController.h +++ b/libraries/APM_Control/AP_SteerController.h @@ -50,6 +50,9 @@ public: _reverse = reverse; } + // Returns true if controller has been run recently + bool active() const; + private: AP_Float _tau; AP_Float _K_FF;