From 2ce964c8acf7d9d4f0b71f918cf6cf9e51e80887 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Wed, 20 Apr 2016 15:34:23 -0700 Subject: [PATCH] AP_L1_Controller: add accessor for xtrack_error_integrator --- libraries/AP_L1_Control/AP_L1_Control.cpp | 5 ----- libraries/AP_L1_Control/AP_L1_Control.h | 3 ++- libraries/AP_Navigation/AP_Navigation.h | 4 +++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libraries/AP_L1_Control/AP_L1_Control.cpp b/libraries/AP_L1_Control/AP_L1_Control.cpp index 30a10cc004..91c3515e80 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.cpp +++ b/libraries/AP_L1_Control/AP_L1_Control.cpp @@ -109,11 +109,6 @@ bool AP_L1_Control::reached_loiter_target(void) return _WPcircle; } -float AP_L1_Control::crosstrack_error(void) const -{ - return _crosstrack_error; -} - /** prevent indecision in our turning by using our previous turn decision if we are in a narrow angle band pointing away from the diff --git a/libraries/AP_L1_Control/AP_L1_Control.h b/libraries/AP_L1_Control/AP_L1_Control.h index 4898fba702..203e3cc10a 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.h +++ b/libraries/AP_L1_Control/AP_L1_Control.h @@ -38,7 +38,8 @@ public: // return the heading error angle (centi-degrees) +ve to left of track int32_t bearing_error_cd(void) const; - float crosstrack_error(void) const; + float crosstrack_error(void) const { return _crosstrack_error; } + float crosstrack_error_integrator(void) const { return _L1_xtrack_i; } int32_t target_bearing_cd(void) const; float turn_distance(float wp_radius) const; diff --git a/libraries/AP_Navigation/AP_Navigation.h b/libraries/AP_Navigation/AP_Navigation.h index 6c8860b696..577014a6cb 100644 --- a/libraries/AP_Navigation/AP_Navigation.h +++ b/libraries/AP_Navigation/AP_Navigation.h @@ -45,7 +45,9 @@ public: // return the crosstrack error in meters. This is the distance in // the X-Y plane that we are off the desired track - virtual float crosstrack_error(void) const = 0; + virtual float crosstrack_error(void) const = 0; + virtual float crosstrack_error_integrator(void) const { return 0; } + // return the distance in meters at which a turn should commence // to allow the vehicle to neatly move to the next track in the