Using Elastic#
Overview#
In this section we will be going over
- Using and organizing the Elastic dashboard
- Creating the Telemetry subsystem and adding buttons and data to be viewed in Elastic
What is Elastic#
- Elastic is a modern FRC robot dashboard that displays robot data during development and competition
- It can display widgets like graphs, camera streams, boolean indicators, and number readouts
- Elastic supports tabs to organize widgets into separate pages
- It reads data from NetworkTables, which is the same system used by SmartDashboard — no changes to robot code are needed to switch from Shuffleboard or SmartDashboard to Elastic
Tip
Elastic is available as a standalone download from its GitHub releases page. It can be run independently or configured to launch automatically from the Driver Station. It is also included in the WPILib installation and can be found in the WPILib tools directory.
What is Telemetry#
- Telemetry is where we add data to be viewed or command buttons on Elastic
- For this section of our tutorial we will be adding switch and encoder data to Elastic
- The Java code to publish telemetry data uses
SmartDashboard, which writes to NetworkTables — Elastic reads that data automatically
Creating the Telemetry Subsystem#
1) Create a new Subsystem called Telemetry
2) Create a constructor for the Telemetry class
- The constructor is where we will create buttons for Elastic
3) Inside type:
4) Create a public method called update
- This method will run periodically in Robot.java to update sensor data in Elastic
5) Inside type:
6) Do the same for the getDriveEncoderDistance method
7) Try adding the Shooter Subsystem commands and sensor methods where they should be
Example
Your full Telemetry.java should look like this
public class Telemetry extends Subsystem {
// Put methods for controlling this subsystem
// here. Call these from Commands.
public Telemetry() {
// Drivetrain
SmartDashboard.putData("Reset Drive Encoder", new DriveResetEncoder());
// Shooter
SmartDashboard.putData("Shooter Up", new ShooterUp());
SmartDashboard.putData("Shooter Down", new ShooterDown());
SmartDashboard.putData("Shooter Up Auto", new ShooterUpAuto());
}
public void update() {
// Drivetrain
SmartDashboard.putNumber("Drive Encoder Count", Robot.m_drivetrain.getDriveEncoderCount());
// Shooter
SmartDashboard.putBoolean("Shooter Switch", Robot.m_shooter.isShooterSwitchClosed());
}
@Override
public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
}
}
Adding The Telemetry Subsystem to Robot.java#
1) When adding Telemetry to Robot.java, in robotInit we must add Telemetry after the other subsystems
- This is because the Telemetry subsystem relies on methods that are created in other subsystems before it
- It can be added before or after OI since they don't use methods from each other
Why not robotPeriodic?
robotPeriodic runs at the very start of every loop, before the command scheduler runs. Putting update() there means the displayed values would lag one loop cycle behind the current robot state. By placing update() in mode-specific methods (disabledPeriodic, autonomousPeriodic, teleopPeriodic), the dashboard always reflects the most current values after all commands for that loop have executed.
2) It is important that we add the update method to disabledPeriodic, autonomousPeriodic, and teleopPeriodic so that Elastic is always being updated with information on our sensors.
Example
The code you typed before robotInit should be this
The code you typed in robotInit should be this
m_telemetry = new Telemetry(); //This must be initialized after all other robot subsystems
The code you typed in disabledPeriodic, autonomousPeriodic, and teleopPeriodic should be this
Opening Elastic#
After saving and deploying your code:
Option A — Launch Elastic manually:
- Open the Elastic application directly.
- Elastic will automatically connect to the robot's NetworkTables server when the Driver Station connects to the robot.
Option B — Configure the Driver Station to open Elastic automatically:
- In the Driver Station, click the gear icon on the left side to open settings.
- Under Dashboard Type, select Elastic (or browse to the Elastic executable if it does not appear in the list).
- The Driver Station will launch Elastic automatically when it starts.
Once Elastic is open and the robot is connected, you should see your NetworkTables keys appear in the widget picker.
Using Elastic#
Adding Widgets#
- Right-click on any empty area of a tab to open the widget menu.
- Browse or search the list of available NetworkTables keys (the values your robot is publishing via
SmartDashboard). - Click a key to place it as a widget on the tab.
Tip
Each key published with SmartDashboard.putData, putNumber, or putBoolean will appear as a separate widget option. Commands registered with putData appear as buttons you can click to schedule them.
Tabs#
Tabs let you separate widgets into logical groups — for example one tab for drivetrain data and another for shooter data.
- Click the + button in the tab bar to add a new tab.
- Double-click a tab name to rename it.
- Click a tab to switch to it.
Moving and Resizing Widgets#
- Click and drag a widget's title bar to reposition it.
- Drag from a widget's corner or edge to resize it.
- Right-click a widget for additional options such as renaming or changing its display type.
Saving Layouts#
Elastic saves your layout automatically, but you can also explicitly save and load layout files to share with the team.
- Go to File → Save Layout to save the current arrangement to a
.jsonfile. - Go to File → Open Layout to restore a previously saved layout.
Tip
Save your layout file in your robot project's repository so the whole team can use the same dashboard configuration.