Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
PredictiveStanleyController.h
Go to the documentation of this file.
1
11#ifndef PREDICTIVE_STANLEY_CONTROLLER_H
12#define PREDICTIVE_STANLEY_CONTROLLER_H
13
14#include "../../util/GeospatialOperations.hpp"
15#include "../../util/logging/PathTracer.hpp"
16#include "../kinematics/UnicycleModel.hpp"
17
19#include <vector>
20
22
23
32namespace controllers
33{
34
44 {
45 public:
47 // Declare public class structs.
50 {
51 public:
52 double dThetaHeading;
53 double dVelocity;
54 };
55
57 // Declare public class methods.
59 PredictiveStanleyController(const double dControlGain = 0.1,
60 const double dAngularVelocityLimit = 90.0,
61 const int nPredictionHorizon = 5,
62 const double dPredictionTimeStep = 0.01);
64 DriveVector Calculate(const geoops::RoverPose& stCurrentPose, const double dMaxSpeed = constants::NAVIGATING_MOTOR_POWER);
65
67 // Setters.
69
70 void SetReferencePath(const std::vector<geoops::Waypoint>& vReferencePath);
71 void SetReferencePath(const std::vector<geoops::UTMCoordinate>& vReferencePath);
72 void SetReferencePath(const std::vector<geoops::GPSCoordinate>& vReferencePath);
73 void SetControlGain(const double dControlGain);
74 void SetAngularVelocityLimit(const double dAngularVelocityLimit);
75
77 // Getters.
79
80 std::vector<geoops::Waypoint> GetReferencePath() const;
81 double GetControlGain() const;
82 double GetAngularVelocityLimit() const;
83 double GetReferencePathTargetIndex() const;
84
85 private:
87 // Declare private class methods.
89
91
93 // Declare private member variables.
95
96 UnicycleModel m_UnicycleModel;
97 double m_dControlGain;
98 double m_dAngularVelocityLimit;
99 int m_nPredictionHorizon;
100 double m_dPredictionTimeStep;
101 int m_nCurrentReferencePathTargetIndex;
102 std::vector<geoops::Waypoint> m_vReferencePath;
103 };
104} // namespace controllers
105#endif
This class implements the Unicycle Model. This model is used to predict the future state of the rover...
Definition UnicycleModel.hpp:35
This class implements the Predictive Stanley Controller. This controller is used to follow a path usi...
Definition PredictiveStanleyController.h:44
double GetControlGain() const
Accessor for the control gain of the stanley controller.
Definition PredictiveStanleyController.cpp:320
void SetAngularVelocityLimit(const double dAngularVelocityLimit)
Setter for the angular velocity limit of the stanley controller.
Definition PredictiveStanleyController.cpp:307
void SetReferencePath(const std::vector< geoops::Waypoint > &vReferencePath)
Sets the path that the controller will follow.
Definition PredictiveStanleyController.cpp:230
void SetControlGain(const double dControlGain)
Setter for the control gain of the stanley controller.
Definition PredictiveStanleyController.cpp:294
DriveVector Calculate(const geoops::RoverPose &stCurrentPose, const double dMaxSpeed=constants::NAVIGATING_MOTOR_POWER)
Calculate an updated steering angle for the rover based on the current pose using the predictive stan...
Definition PredictiveStanleyController.cpp:78
double GetAngularVelocityLimit() const
Accessor for the angular velocity limit of the stanley controller.
Definition PredictiveStanleyController.cpp:333
geoops::Waypoint FindClosestWaypointInPath(const geoops::UTMCoordinate &stCurrentPosition)
Given the current position of the rover, find the point on the reference path that is closest to the ...
Definition PredictiveStanleyController.cpp:375
~PredictiveStanleyController()
Destroy the Predictive Stanley Controller:: Predictive Stanley Controller object.
Definition PredictiveStanleyController.cpp:62
double GetReferencePathTargetIndex() const
Accessor for the current target index in the reference path.
Definition PredictiveStanleyController.cpp:359
std::vector< geoops::Waypoint > GetReferencePath() const
Accessor for the reference path that the controller is following.
Definition PredictiveStanleyController.cpp:346
This namespace stores classes, functions, and structs that are used to implement different controller...
Definition PIDController.cpp:26
Definition PredictiveStanleyController.h:50
This struct is used by the WaypointHandler to provide an easy way to store all pose data about the ro...
Definition GeospatialOperations.hpp:708
This struct stores/contains information about a UTM coordinate.
Definition GeospatialOperations.hpp:211
This struct is used by the WaypointHandler class to store location, size, and type information about ...
Definition GeospatialOperations.hpp:423