Skip to content

66-logging-util Initial Implementation#74

Open
KTruntaev wants to merge 7 commits into
tank-botfrom
66-logging-util
Open

66-logging-util Initial Implementation#74
KTruntaev wants to merge 7 commits into
tank-botfrom
66-logging-util

Conversation

@KTruntaev
Copy link
Copy Markdown
Contributor

@KTruntaev KTruntaev commented Mar 11, 2023

Added a utility that allows us to record any sensor reading from the robot into a .csv file.

Added changes within RobotContainer.java & Robot.java, and implemented the util folder.

resolves #66

@KTruntaev KTruntaev requested a review from EddieCanales March 11, 2023 16:23
Comment thread src/main/java/frc/robot/Robot.java Outdated
// block in order for anything in the Command-based framework to work.
CommandScheduler.getInstance().run();

// REMEMBER TO MOVE THIS OUT OF ROBOT PERIODIC
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this comment outdated or do you still intend to move this out?

m_logger.updateFields();
m_logger.log();
} else {
m_logTime += 20;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rather than incrementing this by a fixed 20 here, should we increment by the elapsed time since the last execution?

Comment on lines +91 to +93
public double getMotorSpeed() {
return m_leftA.get();
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe this should return both motor speeds (in an array for example). Otherwise we're only ever able to log the speed of one motor. Alternatively you could create a getLeftMotorSpeed and getRightMotorSpeed.

public void log() {
try {
// TODO: Do not close the writer after each write
FileWriter myWriter = new FileWriter(file,true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can accomplish this by simply initializing a private instance variable in your constructor.

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.

Implement Data Logging

2 participants