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>
56 StanleyController(
const double dKp,
const double dDistToFrontAxle,
const double dYawTolerance);
57 StanleyController(
const std::vector<geoops::UTMCoordinate>& vUTMPath,
const double dKp,
const double dDistToFrontAxle,
const double dYawTolerance);
58 StanleyController(
const std::vector<geoops::GPSCoordinate>& vGPSPath,
const double dKp,
const double dDistToFrontAxle,
const double dYawTolerance);
73 void SetPath(std::vector<geoops::UTMCoordinate>& vUTMPath);
74 void SetPath(std::vector<geoops::GPSCoordinate>& vGPSPath);
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:375
std::vector< geoops::GPSCoordinate > GetPathGPS() const
Getter for path.
Definition StanleyController.cpp:388
unsigned int GetLastTargetIdx() const
Getter for the index of the last target point on the path.
Definition StanleyController.cpp:362
double Calculate(const geoops::UTMCoordinate &stUTMCurrPos, const double dVelocity, const double dBearing)
Calculate the steering control adjustment for an agent using the Stanley method.
Definition StanleyController.cpp:150
void ResetProgress()
Resets the progress on the current path.
Definition StanleyController.cpp:224
StanleyController()
Default constructor for Stanley Controller.
Definition StanleyController.cpp:35
double CalculateTargetBearing(const unsigned int unTargetIdx) const
Calculate the required bearing to navigate from the current target point to the subsequent point on t...
Definition StanleyController.cpp:479
double GetDistanceToFrontAxle() const
Getter for distance to the front axle.
Definition StanleyController.cpp:336
~StanleyController()
Destroy the Stanley Contoller:: Stanley Contoller object.
Definition StanleyController.cpp:131
void SetYawTolerance(const double dYawTolerance)
Setter for yaw tolerance.
Definition StanleyController.cpp:263
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:444
void SetDistanceToFrontAxle(const double dDistToFrontAxle)
Setter for distance to front axle.
Definition StanleyController.cpp:250
double GetYawTolerance() const
Getter for yaw tolerance.
Definition StanleyController.cpp:349
double CalculateCrossTrackError(const geoops::UTMCoordinate &stUTMFrontAxlePos, const unsigned int unTargetIdx, const double dBearing) const
Calculate the cross track error. This error expresses how far off the agent is from the path (lateral...
Definition StanleyController.cpp:532
void SetSteeringControlGain(const double dKpp)
Setter for steering control gain.
Definition StanleyController.cpp:237
double GetSteeringControlGain() const
Getter for steering control gain.
Definition StanleyController.cpp:323
geoops::UTMCoordinate CalculateFrontAxleCoordinate(const geoops::UTMCoordinate &stUTMCurrPos, const double dBearing) const
Calculate the UTM coordinate of the center of the agent's front axle.
Definition StanleyController.cpp:409
void SetPath(std::vector< geoops::UTMCoordinate > &vUTMPath)
Setter for path.
Definition StanleyController.cpp:276
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:148
This struct stores/contains information about a UTM coordinate.
Definition GeospatialOperations.hpp:244