Skip to content

FRC | Programming Environment

uakotaobi edited this page Jan 19, 2019 · 20 revisions

What is this page for?

This wiki page describes how to set up two types of computer systems that are important for FRC:

  • Programming environments.
    To develop robot programs that can be deployed to a RoboRIO, some software must be installed, and other software is recommended. This list occasionally changes, so we use this page to make sure everybody is up-to-date.
  • Driver stations. A Driver Station is a special (unfortunately, Windows-only) laptop that can communicate to the RoboRIO at run-time during the autonomous and teleoperated phases of the competition. Their setup is elaborate, but generally only needs to be done once at the beginning of build season.

Hardware/Software

Regardless of the type of system you're setting up, you will need:

Installation

Universal instructions (2019)

  1. Install [Chocolatey][(https://chocolatey.org), a package manager for Windows.

  2. To install the Java 8 SE development kit:

     choco install jdk8.portable
    
  3. You may need to place C:\tools\jdk_8u192\bin in the $PATH yourself.

Universal instructions (2018 and earlier)

  1. First, the download install the Java JDK, You must accept the license agreement to continue to download.
  2. Then download & install Git.
  3. If your device will be running any code in C++, click here and select the most recent version of the C++ Toolchains for your device.
  4. Go to Eclipse
  5. Download the Eclipse installer and then go to the right top application to update the installer. When the installer restarts then click on Eclipse IDE for Java Developers and install it.
  6. Start Eclipse, and allow it to use the default workspace.
  7. In Eclipse, select Window, then Preferences in the menu bar. If C/C++ is on the left side somewhere, skip to the next step. If not, close the Preferences window, select Help, then Install New Software. Click the dropdown and select "Neon" in the "Work With:" Section. Scroll down to Programming Languages and expand the section. Click the checkbox next to "C/C++ Development Tools". Click Next, and restart eclipse.
  8. Return to the Preferences menu. Choose Java Preferences, then Installed JREs. Make sure that the installed JDK is shown. If it isn't, click "Add", then select "Standard VM". Click "Next" and then "Directory". Find the JDK folder and click "OK" then "Finish".
  9. Restart Eclipse and Select "Help", then "Install new software". Press the "Add" button. In the Name box, type, "FRC Plugins". In location paste the following link: http://first.wpi.edu/FRC/roborio/release/eclipse/
  10. Click Next and select all folders. When it is done, close Eclipse.
  11. Install the CANTalon build libraries. - Download CTRE library for Non-Windows or Download CTRE library for Windows - If you downloaded the Non-windows version follow the steps in the Readme file. If you downloaded the Windows version then run the .exe file and you will be set. - When it is done you can create a new file in Eclipse and test to see if CTRE library is there by typing in "CTRE." and hit control space.

Universal instructions (2019)

  1. Install [Chocolatey][(https://chocolatey.org), a package manager for Windows.

  2. To install the Java 8 SE development kit:

     choco install jdk8.portable
    
  3. You may need to place C:\tools\jdk_8u192\bin in the $PATH yourself.

Additional Driver Station Instructions

These instructions require a Windows machine with Internet Explorer 11.

  1. Download the FRC driver station software.
  2. Install Microsoft Silverlight.
  3. Download the CTRE Lifeboat Imager. We will use this to install a web application on the RoboRIO (it will also install some additional firmware on the computer where it is run).
  4. Assign the ports using the web interface.
  • Connect the driver station to the RoboRIO via a USB-A cable.
  • Go to the web interface using Internet Explorer.
  • Verify that all the CANTalons on the electronics board are listed in the web interface.
  • For each device, select the device from the left menu, enable the Light Device LEDs checkbox, then click Save. You should see the corresponding CANTalon controller flashing its LEDs in rapid succession.
  • Verify that each device lights up and that the port assignment in the web interface corresponds to the label on the physical device which is lighting up.
  • Open the folder C:\Users\Public\Public Documents\PRS and verify it has been created by the CTRE Phoenix installer.
  • For each device in the web interface, check the firmware version listed. Check the firmware version in the C:\Users\Public\Public Documents\PRS folder, and continue to the next steps if the version numbers are different.
  • Log in to the web interface; there is a login button in the top right. The username is admin and the password field should be left blank.
  • For each device with an outdated firmware version, select its entry in the web interface. Select the Update Firmware button, and navigate to the C:\Users\Public\Public Documents\PRS folder in the file explorer. Select the firmware and select the update button to begin flashing the new firmware.
  1. Redeploy the code using the driver station.

Version control

Robotics programmers for the ESHS FRC team are expected to check their code into version control on a regular basis. (The alternative, storing code on easily-misplaced USB sticks, has been tried in the past, and is completely untenable.) At the time of writing, we are using Git for source control.

Please note that Git and GitHub are not the same thing, any more than "streaming video" and "YouTube" are the same thing. GitHub's just the hosting provider we happen to be using right now. Git is the source control system we'd use whether GitHub was accessible to us or not.

This wiki page you're reading right now is part of the database database Git repository. We tend to use a separate wiki repository for each year's robot:

If the repository does not yet exist and we need to check code in, please create it.

Deploying

172.22.11.2

NetworkTables (WASD) Input Setup

  • Raspberry Pi Only Run the command sudo apt-get install openjfx
  • Run the build_jar script in the networktables-input folder of this repository
    • Internet is required for it to download the NetworkTables library
    • Dependencies
      • Ant: It can be downloaded from Apache's website
      • cURL: It is installed in Raspbian and Git Bash for Windows by default but must be added when using Cygwin
      • JDK 8

Support for Multiple Cameras. Following the guide from FRC 2019 Control System (https://github.com/eshsrobotics/2019bot.git), code can be added through a Camera class, with a method to add another CameraServer using a usb camera. However, be aware that there are only 2 USB ports, so running more is redundant.

Tips for working with Visual Studio Code

  1. To use Visual Studio Code as the editor for Git commit messages, you should set the GIT_EDITOR environment variable to "C:\Users\Public\frc2019\vscode\Code.exe" --wait (or wherever the VSCode binary is located.) The quotes are mandatory, and the --wait argument should occur after the quotes.
Clone this wiki locally