SmartDashboard - LdhssRobotics/How-Tos-2015 GitHub Wiki

By: Haowei Zheng (hw2zheng)

##Why SmartDashboard?

The SmartDashboard is a Java application made by FRC which can be used to send and receive data from the roboRIO while the robot is running, allowing users to dynamically view data from the robot. It includes many features, including a camera viewer and variable outputs. This makes for easier debugging and helps the driver better control the robot.

For example, if I wanted to test the usefulness of the Ultrasonic device of a robot, I would output the distance value that the Ultrasonic returns to the SmartDashboard, which would update in realtime and allow me to view the distance the robot is from the thing in front of the Ultrasonic.

##Sending values to SmartDashboard

Now you might be asking: How exactly do I send outputs to the SmartDashboard? It's not too hard. The SmartDashboard class in Eclipse comes with 3 different functions to output variable values to the robot.

SmartDashboard::PutNumber("Tag", value) SmartDashboard::PutBoolean("Tag", value) SmartDashboard::PutString("Tag", value)

Put_____ puts a widget on the SmartDashboard, which is labeled whatever value is inside "Tag", and which has a value of whatever is put inside "value". "value" can be anything, as long as the datatype of the value matches the datatype specified.

For example, code which outputs the distance from the robot, in the example above, would be written like this:

This would output the range in inches, and update once every 0.05 seconds.

##Opening SmartDashboard

SmartDashboard is an application, and can be opened by searching "SmartDashboard". It can only be used on computers which are running the Driver Station, so most of the time the dashboard used will be the one on the Classmate. This can be accessed by searching "SmartDashboard" on the search function. All widgets will appear automatically when the robot is enabled.

The opened dashboard will look like this at first:

It looks a bit bland, so maybe we should switch up the layout.

##Editing Layout

You can edit the layout of the SmartDashboard to make it visually appealing. You can also add new features.

To make a background, go to View->Add->Image

Now right click the black image (Ensure Editable is checked!), and click Properties

Select Image File and Maintain Aspect Ratio. Now you can select image file you want as your background.

Resize it until it fits

Now you have your own personalized background!

You can also add a connection indicator, which will tell you if you are connected to the robot.

View->Add->Connection Indicator

It will look like this when you are not connected, and turn green if connected

You can also add a camera, from View->Add->USB Webcam Viewer, which can take live feed off of a USB Camera. However, you must first adjust the IP settings in order to connect properly to the webcam.

It will look like this, and provide the drivers with live feed. It is recommended that the camera is set up in front of the robot, to give drivers extra vision.

You can change backgrounds, add other images, and move everything around to make your own personalized SmartDashboard. It definitely looks cool, so do your best to try it out!