diff --git a/sunray/LineTracker.cpp b/sunray/LineTracker.cpp index 858d3af93..d561076e5 100644 --- a/sunray/LineTracker.cpp +++ b/sunray/LineTracker.cpp @@ -268,7 +268,9 @@ void trackLine(bool runControl){ //CONSOLE.println(angular/PI*180.0); if (maps.trackReverse) linear *= -1; // reverse line tracking needs negative speed // restrict steering angle for stanley (not required anymore after last state estimation bugfix) - //if (!SMOOTH_CURVES) angular = max(-PI/16, min(PI/16, angular)); + if (STANLEY_STEERING_RESTRICTION) { + if (!SMOOTH_CURVES) angular = max(-PI/16, min(PI/16, angular)); + } } // check some pre-conditions that can make linear+angular speed zero if (fixTimeout != 0){ diff --git a/sunray/config_example.h b/sunray/config_example.h index fe0bfbdd8..ae3875306 100644 --- a/sunray/config_example.h +++ b/sunray/config_example.h @@ -394,6 +394,7 @@ Also, you may choose the serial port below for serial monitor output (CONSOLE). #define STANLEY_CONTROL_P_SLOW 3.0 // 3.0 for path tracking control (angular gain) when docking tracking #define STANLEY_CONTROL_K_SLOW 0.1 // 0.1 for path tracking control (lateral gain) when docking tracking +#define STANLEY_STEERING_RESTRICTION false // restrict steering angle for stanley (set to true to activate) // ----- other options --------------------------------------------