Real Time Point Plotting with X and Y Values

Hey everyone!

So recently we were able to get robot pose estimation working. We wanted to see how accurate it was by visualizing the x and y coordinates that we are getting from our program by plotting it.

From my knowledge, neither smartDashboard nor Shuffleboard can plot a point given the x and y values over network tables.

Is there any way to plot the point real time as the robot code is running? Or is our only hope, for now, to plot after logging it into a csv?

I was planning on working on a shuffleboard plugin but just wanted to know if there are any solutions already out there.

We use Java as our programming language.

Regards
Gagan Bhat

We did pose estimation this year with a swerve drive for the first time. We built a small tool in python using the animate feature in matplotlib. We have scripts to log the data to csv and then replay it. We also have a live version that reads directly from network tables instead of csv.

Here is the live version*
https://github.com/Frc2481/frc-2018/blob/feature/ObserverPlotting/ObserverPlotter/live/liveObserverPlotter.py

Here is the csv version.
https://github.com/Frc2481/frc-2018/blob/feature/ObserverPlotting/ObserverPlotter/observerPlotter.py

Here is the code that publishes the data.
https://github.com/Frc2481/frc-2018/blob/feature/auto_tuning/src/DriveTrainPathFollower.cpp#L119

Thanks goes out to Dustin Spicuzza for guiding us down the path to send a single array rather than individual values and providing sample logging scripts.

Hope this helps. Let me know if you have questions.

*I made our entire 2018 repo public to share the plotting utility and accompanying robot code. We’ve made 0 effort to clean things up at this point in the rest of the robot code. Note the plotting utility and the main robot code are on two different branches.

EDIT: It looks like the live version was never updated to read from the array instead of individual values. You can publish ‘Field X’, ‘Field Y’, ‘Path Actual Heading’, ‘PathX’, ‘PathY’, and ‘PathYaw’. We primarily used this for auto development and we found live didn’t give us a huge benefit so we utilized the csv version the most.

Thanks a ton for sharing this!

I just ran the live script and it sure looks great! Waiting until we have our next meeting in order to try it out =)

Regards
Gagan Bhat