Maple-Dash is a minimalist dashboard that only focus on helping drivers on the field. Unlike most other dashboard, Maple Dashboard can not be customized. This design choice help drivers to only focus on the things they must know.
Part of this code is generated by ChatGPT.
Outer colour ring representing status of the robot. When FMS is connected, a FMS Connected message will also be shown.
- Grey - Disconnected
- Red - Disabled
- Blue - Auto
- Green - Teleop
- Yellow - Test
RGB values of the inner part of the dashboard could be set though networktables
A terminal alike printout area that can be used to print message for diagnosis. Colour of the printout can be set as well.
Two line of text that can be custom set. Also when necessary, it can be set to flashing. The colour of the text can't be custom set as it will always be the invert colour of the background. This ensure the text is always visiable
Three chime sound playable by toggling three different networktables bool. Chime 1 and 2 will always be played once while chime 3 will loop until nt bool is set to false.
(There is no gif to this as gif don't contain sound. use your imagination or download maple dashboard and try it. This is put here so the post looks uniformity.)
A panel to set target networktable server address and clear message terminal.
Text on top can be custom set. Colour will always be invert colour of outer ring. No flashing feature on this top text.
Let's make our drivers' life easier!
- Open the script and set ip address of the roboRIO.
ntinst.setServer("127.0.0.1") # Set the server to the simulated robot's IP (127.0.0.1)
- Install robotpy
- install pygame by
pip install pygame
The dashboard interacts with various elements using NetworkTables
. Here’s a detailed summary of how different data points and controls are managed through NetworkTables
:
- Variables:
DS_R
,DS_G
,DS_B
- Table:
telemetry
- Description: These three integer variables control the color of the main canvas. The values represent the red, green, and blue color channels, respectively.
- Effect: The background of the canvas changes dynamically based on these RGB values, adjusting the visual appearance of the dashboard.
- Large Text:
- Variable:
DS_largetext
(String) - Flash Control:
DS_largetext_flash
(Boolean) - Table:
telemetry
- Description: This string is displayed as the main large text in the center of the canvas. If
DS_largetext_flash
isTrue
, the large text will flash at 0.25-second intervals.
- Variable:
- Small Text:
- Variable:
DS_smalltext
(String) - Flash Control:
DS_smalltext_flash
(Boolean) - Table:
telemetry
- Description: This string is displayed as a smaller text below the large text. If
DS_smalltext_flash
isTrue
, the small text will flash at 0.25-second intervals.
- Variable:
- Effect: Both texts dynamically adjust their font size based on the available canvas space and the length of the text. Flashing is optional and controlled by the respective boolean variables.
-
Variable:
FMSControlData
(Integer) -
Table:
FMSInfo
-
Description: The integer
FMSControlData
controls the color of the edges surrounding the canvas. The value represents the current robot status and whether the robot is connected to the FMS (Field Management System).- Disconnected (
0
): Grey - FMS Attached:
48
: Red (Disabled)49
: Green (Teleoperated)51
: Blue (Autonomous)53
: Yellow (Test Mode)
- FMS Not Attached:
32
: Red (Disabled)33
: Green (Teleoperated)35
: Blue (Autonomous)37
: Yellow (Test Mode)
- Disconnected (
-
Effect: The edges surrounding the canvas change color based on the value of
FMSControlData
. If the FMS is attached (values48
,49
,51
,53
), a message "FMS Connected" is displayed at the bottom of the screen.
-
Chime 1:
- Variable:
DS_chime_1
(Boolean) - Table:
telemetry
- Description: Plays
chime1.mp3
once whenDS_chime_1
is set toTrue
. The chime plays only once untilDS_chime_1
is reset toFalse
, which resets the latch.
- Variable:
-
Chime 2:
- Variable:
DS_chime_2
(Boolean) - Table:
telemetry
- Description: Plays
chime2.mp3
once whenDS_chime_2
is set toTrue
. The chime plays only once untilDS_chime_2
is reset toFalse
, which resets the latch.
- Variable:
-
Chime 3 (Looping):
- Variable:
DS_chime_3
(Boolean) - Table:
telemetry
- Description: Loops
chime3.mp3
continuously whenDS_chime_3
isTrue
. The chime will keep looping untilDS_chime_3
is set toFalse
, which immediately stops the sound.
- Variable:
- Variable:
battVoltage
(Double) - Table:
telemetry
- Description: Displays the current battery voltage on the screen. This is useful for monitoring the robot’s power levels during operation.
- Effect: The battery voltage is rendered at the top right of the screen, showing real-time voltage readings.
The terminal feature is implemented to display a terminal-like text area in the bottom-left corner of the dashboard. New lines of text are added dynamically, with the option to set custom text colors. The text is printed in a top-to-bottom fashion, and the number of visible lines is limited.
Here’s a summary of how the terminal feature is controlled via NetworkTables:
-
Data Entries:
-
DS_terminal_text
(string):- The string that contains the new line of text to be printed in the terminal.
- If this value changes, the new text will be printed at the top of the terminal area.
-
DS_terminal_text_R
,DS_terminal_text_G
,DS_terminal_text_B
(int):- These entries control the RGB color values of the newly printed line of text.
- The values are clamped between
0
and255
to ensure valid RGB values. - Older lines retain the colors they were printed with when initially displayed.
-
DS_terminal_force
(bool):- This entry is used to force printing the current
DS_terminal_text
, even if it hasn’t changed since the last print. - This acts as a button with latching behavior. When set to
True
, the terminal prints the current text regardless of whether it has changed, and the latch ensures it triggers only once per activation. - Once
DS_terminal_force
is reset toFalse
, it can be triggered again for subsequent forced prints.
- This entry is used to force printing the current
-
-
Behavior:
- Normal Text Printing: The text from
DS_terminal_text
is printed whenever it changes. The most recent line is added to the top of the terminal, and older lines are pushed down. - Forced Printing: If
DS_terminal_force
is set toTrue
, the current text is printed even if it hasn’t changed, allowing the same text to be printed multiple times upon request. - Text Color: Each new line of text uses the color specified by
DS_terminal_text_R
,DS_terminal_text_G
, andDS_terminal_text_B
. The colors for each line are retained even as new lines are added.
- Normal Text Printing: The text from
-
Display Area:
- The terminal text is displayed in the bottom-left corner of the canvas, within the available screen space and avoiding the edge reserved for the
FMSInfo
data. - The number of lines displayed is limited to a pre-set maximum (
terminal_max_lines
), and old lines scroll off the screen as new lines are added.
- The terminal text is displayed in the bottom-left corner of the canvas, within the available screen space and avoiding the edge reserved for the
This allows for dynamic terminal-style text display with customizable color and forced printing features, making it flexible for various dashboard use cases.