-
Notifications
You must be signed in to change notification settings - Fork 0
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
66-logging-util Initial Implementation #74
base: tank-bot
Are you sure you want to change the base?
Conversation
src/main/java/frc/robot/Robot.java
Outdated
@@ -44,6 +50,17 @@ public void robotPeriodic() { | |||
// and running subsystem periodic() methods. This must be called from the robot's periodic | |||
// block in order for anything in the Command-based framework to work. | |||
CommandScheduler.getInstance().run(); | |||
|
|||
// REMEMBER TO MOVE THIS OUT OF ROBOT PERIODIC |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
public double getMotorSpeed() { | ||
return m_leftA.get(); | ||
} |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
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