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
PurePursuitController.h
Go to the documentation of this file.
1
11#ifndef PURE_PURSUIT_CONTROLLER_H
12#define PURE_PURSUIT_CONTROLLER_H
13
14#include "../../util/GeospatialOperations.hpp"
15
17#include <vector>
18
20
21
30namespace controllers
31{
32
41 {
42 public:
44 // Declare public structs.
46
47
55 {
56 public:
57 double dThetaHeading;
58 double dVelocity;
59 };
60
62 // Constructors and Destructors.
64
65 PurePursuitController(const double dLookaheadDistance = 2.0, const int nLookaheadIndex = 5);
66 ~PurePursuitController() = default;
67
69 // Declare public class methods.
71
72 DriveVector Calculate(const geoops::RoverPose& stCurrentPose, const double dMaxSpeed);
73
75 // Setters.
77
78 void SetReferencePath(const std::vector<geoops::Waypoint>& vReferencePath);
79 void SetLookaheadDistance(const double dLookaheadDistance);
80 void SetLookaheadIndex(const int nLookaheadIndex);
81
83 // Getters.
85
86 std::vector<geoops::Waypoint> GetReferencePath() const;
87 double GetLookaheadDistance() const;
89
90 private:
92 // Declare private class methods.
94
95 int FindClosestWaypointIndex(const geoops::UTMCoordinate& stCurrentPosition);
97
99 // Declare private member variables.
101
102 double m_dLookaheadDistance;
103 int m_nLookaheadIndex;
104 int m_nCurrentReferencePathTargetIndex;
105 std::vector<geoops::Waypoint> m_vReferencePath;
106 };
107} // namespace controllers
108#endif
This class implements the Pure Pursuit Controller. This controller is used to follow a path by calcul...
Definition PurePursuitController.h:41
DriveVector Calculate(const geoops::RoverPose &stCurrentPose, const double dMaxSpeed)
Calculate an updated drive vector for the rover based on the current pose using the pure pursuit cont...
Definition PurePursuitController.cpp:59
geoops::Waypoint FindLookaheadWaypoint(const geoops::UTMCoordinate &stCurrentPosition)
Searches forward from the current target index to find a point that is at least the lookahead distanc...
Definition PurePursuitController.cpp:266
void SetLookaheadDistance(const double dLookaheadDistance)
Set the Lookahead Distance object.
Definition PurePursuitController.cpp:145
std::vector< geoops::Waypoint > GetReferencePath() const
Get the Reference Path object.
Definition PurePursuitController.cpp:171
void SetLookaheadIndex(const int nLookaheadIndex)
This will allow us to set the max amount of indices to lookahead.
Definition PurePursuitController.cpp:158
int GetReferencePathTargetIndex() const
Get the Reference Path Target Index object.
Definition PurePursuitController.cpp:197
int FindClosestWaypointIndex(const geoops::UTMCoordinate &stCurrentPosition)
Finds the closest waypoint index in the path to the current position, enforcing topological blinders ...
Definition PurePursuitController.cpp:212
void SetReferencePath(const std::vector< geoops::Waypoint > &vReferencePath)
Set the Reference Path object.
Definition PurePursuitController.cpp:130
double GetLookaheadDistance() const
Get the Lookahead Distance object.
Definition PurePursuitController.cpp:184
This namespace stores classes, functions, and structs that are used to implement different controller...
Definition PIDController.cpp:26
The struct for the drive vector that includes heading and velocity.
Definition PurePursuitController.h:55
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