Skip to content

Conversation

@KTruntaev
Copy link
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
// 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
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
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
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
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

3 participants