FRC2706 / 2024-2706-Robot-Code

Code for the 2024 game.
Other
3 stars 0 forks source link

Add URCL and refactor CANIDs into an enum #123

Open ErikCald opened 2 months ago

ErikCald commented 2 months ago

Describe your changes

Hardware has been asking for more logging of sparkmax data. So this PR is for Brian. URCL will be the easiest way to make sure they can get as much data logged as possible without them needing to constantly ask software to add a new log entry.

URCL is the unofficial rev-compatible logger. It will automatically publish all rev can status frames to network tables which is then logged by the WPILib logger.

Tested on Apollo at MVS. Tested with and without for 3 minutes each. Without URCL, the log file was 4 MB large. With URCL, it was 8 MB large. Based on this test, it will double the size of our logs files but it is still very manageable on a USB stick.

Checklist before requesting a review

weizhang-2706 commented 2 months ago

My only concern is that this may impact performance during competitions due to many CAN status frames and writing to USB stick. We can definitely use it during debug and may only focus on some which need this log.

ErikCald commented 2 months ago

URCL is only logging the can periodic status frames that are already sent to the RIO so it won't cause any extra can bus utilization.

URCL claims it needs less than 80 micro seconds each robot cycle so it also doesn't cost much for RIO usage.

And I highly recommend running it at competition because it doesn't cost much in resources but gives hardware team 95% of the logging they want to see.

weizhang-2706 commented 2 months ago

I am a little worried about writing to the USB stick. We will put it in our regular debugging routine and monitor any possible issue.