11#ifndef STANLEY_CONTROLLER_H 
   12#define STANLEY_CONTROLLER_H 
   14#include "../../util/GeospatialOperations.hpp" 
   15#include "../../util/NumberOperations.hpp" 
   21#include <gtest/gtest.h> 
   55            StanleyController(
const double dKp = 1.0, 
const double dDistToFrontAxle = 1.0, 
const double dYawTolerance = 1.0);
 
   56            StanleyController(
const std::vector<geoops::UTMCoordinate>& vUTMPath, 
const double dKp, 
const double dDistToFrontAxle, 
const double dYawTolerance);
 
   57            StanleyController(
const std::vector<geoops::GPSCoordinate>& vGPSPath, 
const double dKp, 
const double dDistToFrontAxle, 
const double dYawTolerance);
 
   72            void SetPath(
const std::vector<geoops::UTMCoordinate>& vUTMPath);
 
   73            void SetPath(
const std::vector<geoops::GPSCoordinate>& vGPSPath);
 
   74            void SetPath(
const std::vector<geoops::Waypoint>& vWaypointsPath);
 
   86            std::vector<geoops::UTMCoordinate> 
GetPathUTM() 
const;
 
   87            std::vector<geoops::GPSCoordinate> 
GetPathGPS() 
const;
 
  104            double m_dDistToFrontAxle;                        
 
  105            double m_dYawTolerance;                           
 
  106            unsigned int m_unLastTargetIdx;                   
 
  107            std::vector<geoops::UTMCoordinate> m_vUTMPath;    
 
  108            std::vector<geoops::GPSCoordinate> m_vGPSPath;    
 
 
Provides an implementation of a lightweight lateral StanleyController. This algorithm is used to prec...
Definition StanleyController.h:50
 
std::vector< geoops::UTMCoordinate > GetPathUTM() const
Getter for path.
Definition StanleyController.cpp:393
 
std::vector< geoops::GPSCoordinate > GetPathGPS() const
Getter for path.
Definition StanleyController.cpp:406
 
unsigned int GetLastTargetIdx() const
Getter for the index of the last target point on the path.
Definition StanleyController.cpp:380
 
geoops::UTMCoordinate CalculateFrontAxleCoordinate(const geoops::UTMCoordinate &stUTMCurrPos, const double dCurrentHeading) const
Calculate the UTM coordinate of the center of the agent's front axle.
Definition StanleyController.cpp:434
 
void SetPath(const std::vector< geoops::UTMCoordinate > &vUTMPath)
Setter for path.
Definition StanleyController.cpp:267
 
void ResetProgress()
Resets the progress on the current path.
Definition StanleyController.cpp:215
 
double CalculateTargetBearing(const unsigned int unTargetIdx) const
Calculate the required heading to navigate from the current target point to the subsequent point on t...
Definition StanleyController.cpp:504
 
double GetDistanceToFrontAxle() const
Getter for distance to the front axle.
Definition StanleyController.cpp:354
 
~StanleyController()
Destroy the Stanley Contoller:: Stanley Contoller object.
Definition StanleyController.cpp:120
 
void SetYawTolerance(const double dYawTolerance)
Setter for yaw tolerance.
Definition StanleyController.cpp:254
 
unsigned int IdentifyTargetIdx(const geoops::UTMCoordinate &stUTMFrontAxlePos) const
Identifies the closest point to the center of the agent's front axle on the path.
Definition StanleyController.cpp:469
 
void SetDistanceToFrontAxle(const double dDistToFrontAxle)
Setter for distance to front axle.
Definition StanleyController.cpp:241
 
double GetYawTolerance() const
Getter for yaw tolerance.
Definition StanleyController.cpp:367
 
void ClearPath()
Clear the current path.
Definition StanleyController.cpp:418
 
void SetSteeringControlGain(const double dKpp)
Setter for steering control gain.
Definition StanleyController.cpp:228
 
double CalculateCrossTrackError(const geoops::UTMCoordinate &stUTMFrontAxlePos, const unsigned int unTargetIdx, const double dCurrentHeading) const
Calculate the cross track error. This error expresses how far off the agent is from the path (lateral...
Definition StanleyController.cpp:558
 
double GetSteeringControlGain() const
Getter for steering control gain.
Definition StanleyController.cpp:341
 
double Calculate(const geoops::UTMCoordinate &stUTMCurrPos, const double dVelocity, const double dCurrentHeading)
Calculate the steering control adjustment for an agent using the Stanley method.
Definition StanleyController.cpp:139
 
This namespace stores classes, functions, and structs that are used to implement different controller...
Definition PIDController.cpp:26
 
This struct stores/contains information about a GPS data.
Definition GeospatialOperations.hpp:99
 
This struct stores/contains information about a UTM coordinate.
Definition GeospatialOperations.hpp:195