Skip to content
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

check for and possibly bootstrap {config, logs} dirs on USB drive #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dejabot
Copy link
Contributor

@dejabot dejabot commented Feb 5, 2024

Description

This PR adds support to check for the presence of the USB drive, and if present, ensure each of the following directories exist or are created:

  • /U/config
  • /U/logs

Based on whether or not the USB drive is present and the above succeeds, chooses where to read/write configs and where to log.

How Has This Been Tested?

Need to test on BurroBot when back by one.

  • Unit tests: [Add your description here]
  • Simulator testing: [Add your description here]
  • On-robot bench testing: [Add your description here]
  • On-robot field testing: [Add your description here]

@dejabot dejabot requested a review from rcahoon February 5, 2024 01:44
@dejabot dejabot changed the title check for config, logs dir on USB drive check for and possibly bootstrap {config, logs} dirs on USB drive Feb 5, 2024
@dejabot
Copy link
Contributor Author

dejabot commented Feb 5, 2024

looking for early feedback - does this make sense to you to do? (I think you suggested something along these lines earlier)

*/
private static boolean checkOrCreateDirectory(String dir) {
File dirFile = new File(dir);
if (!dirFile.exists()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe isDirectory?

@@ -107,7 +143,7 @@ public void robotInit() {

// set up AdvantageKit logging
DataLogManager.log("Initializing logging.");
Logger.addDataReceiver(new WPILOGWriter("/U/logs")); // Log to sdcard
Logger.addDataReceiver(new WPILOGWriter(logsDir)); // Log to sdcard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment still accurate?

create if necessary
use usb or internal config, logs as appropriate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants