-
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
LED Panel! #181
LED Panel! #181
Conversation
class LEDPanel: | ||
# Key: Match number, Value: Drop Bears match number (<=15) | ||
# TODO: Fill with proper values when the draw comes out | ||
matches: dict[int, int] = {1: 1} |
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 match schedule has been published. Do you intend to fill this in now?
self.send_packet() | ||
|
||
def execute(self) -> None: | ||
self.set_match_state() |
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 seems to send a packet multiple times each control loop iteration. Is this necessary?
self.panel_port = wpilib.SerialPort( | ||
baudRate=9600, port=wpilib.SerialPort.Port.kUSB1, dataBits=8 | ||
) | ||
self.set_match_id() |
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 happens on robot code start. getMatchNumber
will always be invalid in this scenario, as the Driver Station will not have connected to the robot.
match_id = 0 | ||
if ( | ||
match_type == wpilib.DriverStation.MatchType.kQualification | ||
or match_type == wpilib.DriverStation.MatchType.kElimination |
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.
Will both this robot code and the LED panel code be updated after every playoff match? Sounds tedious.
or match_type == wpilib.DriverStation.MatchType.kElimination | ||
): | ||
match_number = wpilib.DriverStation.getMatchNumber() | ||
if match_number in self.matches: |
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 looks up the match number without using the match type. Is QF4 intended to be considered identical to Q4?
elif wpilib.DriverStation.getMatchTime() <= 0: | ||
# Post match |
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.
Wouldn't this branch be hit before a match, and between auto and teleop, too?
Closing since the LED panel was ultimately removed from the robot at competition. |
No description provided.