-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental Merge of A* Testing Branch | New Graphing Utility! #365
Merged
+3,683
−633
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… present it doesn't freeze the program.
Here's the code health analysis summary for commits Analysis Summary
Code Coverage Report
|
Byrdman32
approved these changes
Feb 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dev-environment
Issues or enhancements related to setting up or maintaining the development environment.
docker
Tasks or issues related to Docker containerization, including Dockerfile configuration and environme
enhancement
Requests for new features or improvements to existing features.
logging
Tasks related to improving, fixing, or adding logging capabilities to the system.
state-machine
Issues related to the implementation, design, or modification of state machines in the system.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is an incremental merge of the
feature/astar-testing
branch. The branch was originally created to verify the functionality of the A* and Stanley Controller algorithms, but I quickly realized that we desperately needed a good way to visualize what the algorithms and rover were actually doing. I decided to do something similar to what the python codebase had, but it's much more modular and easy to use. A new library has been added:matplotplusplus
. This library provides a similar interface to python's matplotlib, but is actually completely different and uses the gnuplot-nox package in the background the generate the graphs. It is much faster and works almost identically.Changes Made
PathTracer2D.hpp
andPlotsAndGraphs.hpp
util classesHow It Works
m_pRoverPathPlot = std::make_unique<logging::graphing::PathTracer>("NavigatingRoverPath");
m_pRoverPathPlot->AddPathPoints(m_vSearchPath, "SpiralSearchPattern");
// Linem_pRoverPathPlot->AddDots(m_vSearchPath, "VerticalZigZagSearchPattern");
// Scatterm_pRoverPathPlot->AddPathPoint(stCurrentRoverPose.GetUTMCoordinate(), "RoverPath");
// Linem_pRoverPathPlot->AddDot(stCurrentRoverPose.GetUTMCoordinate(), "VerticalZigZagSearchPattern");
// ScatterAdding points are automatically rate limited to avoid updating the graph too many times per second. If you want to add a list of points in bulk to the graph, you can use the AddPathPoints(). If you have a line path that you want to update periodically, say a rover path, then you can just call AddPathPoint(). The user doesn't need to add any timing code, they can call AddPathPoints() or AddPathPoint() every iteration, and it will rate-limit the graph for them. If the user want to forgo the rate limit or change it, then they can pass the desired update interval limit as a 3rd argument to the function, see example below:
Testing
Leads should determine if the graph util file needs unit tests or something,
I have yet to write unit tests for the PredictiveStanleyController class. Honestly, both version of stanley don't work very well at the moment, so I'm not sure if we're going to keep stanley. I'm going to hold off on the unit tests until I know they're worth writing.
Screenshots/Video (if applicable)
The generated graphs are written to the current log folder in a new



path_plots
directory:Each time a new Navigating or SearchPattern state is made new graphs are generated and old ones from past states remain saved in the logs directory. You can also abort/save a state and then resume it and it will continue to update the same graph from before. Graphs are only close/opened when a state is destroyed/created respectively.
Additional Context
I think this will be very nice during testing and even during competition. Since we'll have a good way to sort of look into what autonomy is computing and what it's doing. The graphs can opened normally in VSCode (also works through a remote VSCode connection via SSH) and viewed live while the rover is driving.
I also measured it, the bandwidth usage of viewing the graph through VSCode is very low, it sends less than 100kb/s, so it shouldn't really affect us at competition unless are signals are dog slow.