-
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
Driver dashboard alerts #51
base: main
Are you sure you want to change the base?
Conversation
@@ -122,6 +124,7 @@ public void robotPeriodic() { | |||
// the Command-based framework to work. | |||
CommandScheduler.getInstance().run(); | |||
if (Constants.currentMode == Constants.Mode.REAL) robotContainer.odometrySignalRefresher.periodic(); | |||
AlertManager.getInstance().update(); |
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.
Does this take any considerable amount of time with the NT stuff? (wpilib apparently has profiling tools somewhere)
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.
The alerts don't publish very much stuff to NT, so this shouldn't take a significant amount of time. We could profile it if we see loop overruns because of SmartDashboard.updateValues()
. I can take a look at this when a test on the robot.
inputs.driveMotorConnected = BaseStatusSignal.refreshAll( | ||
driveVelocity, | ||
driveAppliedVolts, | ||
driveCurrent, | ||
driveTempCelsius, | ||
turnAbsolutePosition, | ||
driveTempCelsius).isOK(); | ||
inputs.turnMotorConnected = BaseStatusSignal.refreshAll( | ||
turnVelocity, | ||
turnAppliedVolts, | ||
turnCurrent, | ||
turnTempCelsius); | ||
turnTempCelsius).isOK(); | ||
inputs.turnEncoderConnected = BaseStatusSignal.refreshAll(turnAbsolutePosition).isOK(); |
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.
This provides a performance improvement over separately calling refresh() on each signal.
Javadoc says that ^, do we know if it's enough to matter on the 250hz bus?
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.
Refresh is a non-blocking call, so the performance improvement is probably minimal. These signals are being update at 50hz, only drive and turn position are on 250hz
Adds an alert display to the driver dashboard, allows drivers to see issues that the robot has detected (motor/camera disconnected, CAN bus disconnected, low battery, etc.). Only works on Elastic or Shuffleboard. Functionality of CAN error detection still needs to be to be tested on actual robot.
Alerts look like this:
(make your best guess as to where most of this code came from, it certainly was not me)