![]() |
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.
|
The PathTracer class is used to trace the path of the rover and plot the path on a 2D graph. More...
#include <PathTracer2D.hpp>
Public Member Functions | |
PathTracer (const std::string &szPlotTitle="Graph") | |
Construct a new Path Tracer object. | |
~PathTracer () | |
Destroy the Path Tracer object. | |
bool | CreatePathLayer (const std::string &szLayerName, const std::string &szStyleString="-o") |
Add a new draw layer to the plot. | |
bool | CreateDotLayer (const std::string &szLayerName, const std::string &szColorString="blue", const bool bFillMarkerFace=true) |
Add a new draw layer to the plot. | |
bool | DeleteLayer (const std::string &szLayerName) |
Delete a draw layer from the plot. | |
bool | ClearLayer (const std::string &szLayerName) |
Clear the path or dots of a layer. | |
void | AddPathPoint (const geoops::Waypoint &stWaypoint, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1) |
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddPathPoint (const geoops::UTMCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1) |
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddPathPoint (const geoops::GPSCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1) |
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddPathPoints (const std::vector< geoops::Waypoint > &stWaypoints, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1) |
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints that can be added per call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddPathPoints (const std::vector< geoops::UTMCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1) |
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints that can be added per call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddPathPoints (const std::vector< geoops::GPSCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1) |
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddDot (const geoops::Waypoint &stWaypoint, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1) |
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddDot (const geoops::UTMCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1, const double dDotRadius=5) |
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddDot (const geoops::GPSCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1, const double dDotRadius=5) |
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddDots (const std::vector< geoops::Waypoint > &stWaypoints, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1) |
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddDots (const std::vector< geoops::UTMCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1, const double dDotRadius=5) |
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit. | |
void | AddDots (const std::vector< geoops::GPSCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1, const double dDotRadius=5) |
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit. | |
Private Member Functions | |
void | UpdatePlot () |
Update the plot with the new waypoints and redraw the plot. | |
bool | CheckPathUpdateTime (const std::string &szLayerName, const uint unMaxUpdatesPerSecond) |
Checks the unordered map of last update times for a given layer name and returns true if the time since the last update is greater than the maximum updates per second, then it updates the time in the map. If the layer name does not exist in the map then it returns false. If the given update time is 0, then it will just check if the layer name exists in the map. | |
bool | CheckDotUpdateTime (const std::string &szLayerName, const uint unMaxUpdatesPerSecond) |
Checks the unordered map of last update times for a given layer name and returns true if the time since the last update is greater than the maximum updates per second, then it updates the time in the map. If the layer name does not exist in the map then it returns false. If the given update time is 0, then it will just check if the layer name exists in the map. | |
The PathTracer class is used to trace the path of the rover and plot the path on a 2D graph.
|
inline |
Construct a new Path Tracer object.
|
inline |
Destroy the Path Tracer object.
|
inline |
Add a new draw layer to the plot.
szLayerName | - The alias name of the layer. |
szStyleString | - The style of the layer. Default is "-o" which is a blue line with blue dots. Here are the full options for the style string: Line Styles: "-": Solid line "--": Dashed line "-.": Dash-dot line ":": Dotted line Marker Styles "+": Plus sign "o": Circle "*": Asterisk ".": Point "x": Cross "s" or "square": Square "d" or "diamond": Diamond "^": Upward-pointing triangle "v" or "V": Downward-pointing triangle ">": Custom marker (right arrow, ▶) "<": Custom marker (left arrow, ◀) "p" or "pentagram": Pentagram "h" or "hexagram": Hexagram |
Colors: (These colors can be used for line color, marker color, or marker face color. The letter corresponds to a color) "b": Blue "k": Black "r": Red "g": Green "y": Yellow "c": Cyan "m": Magenta "w": White Additional Options: "f" or "filled": Fills the marker's face (if the marker style supports it). Line width and marker size can be adjusted programmatically, not directly in the style string. Example Usage of Style Strings You can combine line styles, marker styles, and colors into a single string:
"--o": Dashed line with circle markers. ":x": Dotted line with cross markers. "-r": Solid red line. "o": Circle markers with default line style (solid). "-om": Solid magenta line with circle markers.
|
inline |
Add a new draw layer to the plot.
szLayerName | - The alias name of the layer. |
szColorString | - The color of the layer. The default is "blue". Here are the full options for the color string: "blue": Blue "black": Black "red": Red "green": Green "yellow": Yellow "cyan": Cyan "magenta": Magenta "white": White |
bFillMarkerFace | - Whether or not to fill the marker face. Default is true. |
|
inline |
Delete a draw layer from the plot.
szLayerName | - The alias name of the layer. |
|
inline |
Clear the path or dots of a layer.
szLayerName | - The alias name of the layer. |
|
inline |
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit.
stWaypoint | - The waypoint to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
nMaxWaypointsPerSecond | - The maximum number of waypoints that can be added per second. |
|
inline |
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit.
stCoordinate | - The coordinate of the waypoint to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
nMaxWaypointsPerSecond | - The maximum number of waypoints that can be added per second. |
|
inline |
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit.
stCoordinate | - The coordinate of the waypoint to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
nMaxWaypointsPerSecond | - The maximum number of waypoints that can be added per second. |
|
inline |
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints that can be added per call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit.
stWaypoints | - The waypoints to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
unMaxUpdatesPerSecond | - The maximum number of waypoints that can be added per second. Set to 0 for no limit. |
|
inline |
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints that can be added per call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit.
vCoordinates | - The coordinates to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
unMaxUpdatesPerSecond | - The maximum number of waypoints that can be added per second. Set to 0 for no limit. |
|
inline |
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit.
vCoordinates | - The coordinates to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
unMaxUpdatesPerSecond | - The maximum number of waypoints that can be added per second. Set to 0 for no limit. |
|
inline |
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit.
stWaypoint | - The waypoint to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
nMaxWaypointsPerSecond | - The maximum number of waypoints that can be added per second. |
|
inline |
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit.
stCoordinate | - The coordinate of the waypoint to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
nMaxWaypointsPerSecond | - The maximum number of waypoints that can be added per second. |
dDotRadius | - The radius of the dot to add to the path. |
|
inline |
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be added per second. Set the maximum number of waypoints per second to 0 for no limit.
stCoordinate | - The coordinate of the waypoint to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
nMaxWaypointsPerSecond | - The maximum number of waypoints that can be added per second. |
dDotRadius | - The radius of the dot to add to the path. |
|
inline |
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit.
stWaypoints | - The waypoints to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
unMaxUpdatesPerSecond | - The maximum number of waypoints that can be added per second. Set to 0 for no limit. |
|
inline |
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit.
vCoordinates | - The coordinates to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
unMaxUpdatesPerSecond | - The maximum number of waypoints that can be added per second. Set to 0 for no limit. |
dDotRadius | - The radius of the dot to add to the path. |
|
inline |
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be added per one call. But the number of waypoints that can be added per second is limited. Set the maximum number of waypoints per second to 0 for no limit.
vCoordinates | - The coordinates to add to the path. |
szLayerName | - The name of the layer to add the waypoints to. |
unMaxUpdatesPerSecond | - The maximum number of waypoints that can be added per second. Set to 0 for no limit. |
dDotRadius | - The radius of the dot to add to the path. |
|
inlineprivate |
Update the plot with the new waypoints and redraw the plot.
|
inlineprivate |
Checks the unordered map of last update times for a given layer name and returns true if the time since the last update is greater than the maximum updates per second, then it updates the time in the map. If the layer name does not exist in the map then it returns false. If the given update time is 0, then it will just check if the layer name exists in the map.
szLayerName | - The name of the layer to check the update time for. |
unMaxUpdatesPerSecond | - The maximum number of updates per second. |
|
inlineprivate |
Checks the unordered map of last update times for a given layer name and returns true if the time since the last update is greater than the maximum updates per second, then it updates the time in the map. If the layer name does not exist in the map then it returns false. If the given update time is 0, then it will just check if the layer name exists in the map.
szLayerName | - The name of the layer to check the update time for. |
unMaxUpdatesPerSecond | - The maximum number of updates per second. |