From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FIRST Robotics Competition Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Tutorial 6: Creating a Custom Dashboard

 

Tutorial 6—Creating a Custom Dashboard

Use the FRC dashboard project on the host computer to create a custom dashboard that allows you to view data that the roboRIO returns. This project can display images and I/O values that the roboRIO sends to the host computer.

Complete the following steps to create an FRC dashboard project.

  1. Click the FRC Dashboard Project link on the Projects tab in the Getting Started window to display the Create New FRC Dashboard Project dialog box, shown as follows. 1.png

     

  2. In the Project name text box, enter the name you want to use to identify the new FRC dashboard project.
  3. In the Project folder text box, enter the location on the host machine to which you want to save the project files and VIs.
  4. Choose a dashboard project.  Dashboard is the project used to create the prebuilt dashboard.  Dashboard Simple is a new project with less features.  If you don't need all the features of the prebuilt dashboard such as multiple cameras, the Test tab, and Commands tab, this may be an easier project to edit. Dashboard for Maze Robot and Dashboard for Ball Shooter Robot are premade custom dashboards for the Maze and Ball Shooter simulations. For more information on these, see Tutorial 10—Robot Simulation.
  5. Click the Finish button to close the Create New FRC Dashboard Project dialog box and create the new FRC dashboard project. LabVIEW displays the new FRC dashboard project in the Project Explorer

The FRC dashboard project looks similar to the following figure:

2.png

 

Whereas the FRC robot project contains two targets, the FRC dashboard project contains only the My Computer target. You run the VIs in the FRC dashboard project only on a host computer. You do not deploy these VIs to the roboRIO.

The My Computer target contains a Dashboard Main top-level VI and a Support folder. The Support folder contains VIs that the Dashboard Main VI calls. You might not need to modify any of the VIs in this folder.

The Dashboard Main VI is the master VI in the FRC dashboard project. You can use this VI on the host computer to view image data that the camera connected to the roboRIO acquires.

You also can use the Dashboard Main VI to read information about the robot, such as motor drive values, battery level, and any other data you want to send from the robot. In the Project Explorer window, double-click the Dashboard Main.vi item to open the Dashboard Main VI. By default, the front panel displays the following information:

  • Camera Image—The left panel of the dashboard displays the latest image that the camera on the roboRIO acquired. The drop down menu control shows a list of connected cameras to choose from.  If no cameras are connected, this list will be empty.
  • Displaying the camera image might slow performance. Use the control next to the camera menu to configure the dashboard video. By using a smaller image size, slower Frame Rate and higher Compression, video performance can be improved.
  • Drive tab—Displays axis and button information for two joysticks, and drive output information for up to four motors.
  • Camera tab - adds the ability to show a second camera.
  • Basic tab - Displays string message and LED values you can send from the robot.  It also contains Boolean button and numeric slider controls.  The values of these controls can be read from the robot using Smart Dashboard VIs.
  • Custom tab—Displays controls and indicators. Customize this tab with your own controls and indicators, and then write and read data to and from your robot code.  Any control or indicator on the Custom tab gets a variable automatically created with the control or indicator name used as the variable name.
  • Test tab—Displays input and output values for all registered references, and allows you to individually test I/O points. The Driver Station must be in Test mode in order for this tab to work.
  • Commands tab—Displays a list of commands, and allows you to test commands.  This is for use with the Command & Control template. The Driver Station must be in Test mode in order for this tab to work.
  • Checklist tab—Displays a list of robot competition items to be checked before running a match.  You can customize this list to fit your needs.
  • Variables tab—Displays Network Table variables, TestMode variables, and Usage information for the Client and Server of the variables.

Select Window»Show Block Diagram or press the <Ctrl–E> keys to view the block diagram of the Dashboard Main VI. The block diagram contains three While Loops you may choose to edit.

In Loop 1, the Dashboard Main VI receives data about the robot from the driver station. By default, the Dashboard Main VI connects to the driver station through TCP and UDP connections and receives data about the robot. This data includes Status Info, Control Info, Robot Metrics, and Power and Errors information that can be used by the dashboard.  This loop is also used to read Network Table variables from the robot. Notice that "RobotDrive Motors", the string constant value wired to the Name input of the NT Read VI, exactly matches that used for the NT Write VI in the Teleop VI of the robot code.

In Loop 2, the Dashboard Main VI retrieves specific images on the host computer from the image data that either the roboRIO sends, or that is sent directly via the robot radio.  The Dashboard Main VI creates a JPEG image, continuously replaces this image with the most recent image data from the camera, and displays the image in the Image indicator on the front panel.  By default, camera image acquisition is off - you must choose your connected camera type from the front panel menu.

Loop 2.5 adds the ability to show images from a second camera.

Below Loop 2.5 is code that typically does not need to be modified.  There are terminals for Test Mode, Camera Settings, the Basic tab, etc.  There are also additional loops whose purposes are described on the diagram itself.

You can use the WPI Robotics Library VIs and other LabVIEW VIs to modify the types of data the Dashboard Main VI displays.

Modifying the FRC Dashboard Project

The Dashboard Main VI in the FRC Dashboard Project displays information about the robot. You can use the Dashboard Main VI to receive live feedback from the robot. The Dashboard Main VI also displays user-defined data and the input and output values from the roboRIO, the robot, and the driver station. Refer to Tutorial 7—Integrating Examples into Robot Code for information about modifying the dashboard project.

Rebuilding the FRC Dashboard Project

After you customize the FRC Dashboard Project, you must rebuild the project so that the Driver Station launches the most recent version of the project.

Complete the following steps to rebuild the project and specify which project the Driver Station launches automatically.

  1. In the Project Explorer window of the Dashboard Project, expand the list of Build Specifications to reveal the FRC_Dashboard application.
  2. Right-click FRC_Dashboard and select Properties from the shortcut menu. If the Application Builder Information dialog box appears, click OK.
  3. Verify that the Target filename is exe. The Driver Station reads this executable file as the file to launch.
  4. Verify that the Destination directory is where you want to save the file. Click Build to build the new project.
  5. Explore to where you saved the new executable file. Copy the new Dashboard.exe file to the FRC Dashboard folder within Program Files.  You may want to save a backup of the original Dashboard.exe that installed in that folder.
Bill B.
National Instruments
Contributors