wiki1263: Home page

Overview#

Thunder cRIO Tools is primarily a plug-in for the Eclipse IDE that enables easy compilation and deployment of C++ programs to the NI cRIO controller for use in FRC-related activities. The plug-in has been tested to operate alongside the new WPILib plug-ins for C++ development on the new NI roboRIO, so you can easily develop for both controllers in one Eclipse environment. The sections below detail how to install and use the Eclipse plug-in for cRIO C++ development, as well as how to set up (image) the cRIO for use and how to set up the FRC driver station software to interface with the cRIO controller.

Installation#

System Requirements#

Thunder cRIO Tools should work on any Windows-based PC capable of running Eclipse. Linux and other OSs are not supported at this time because Eclipse already supports cross-compilation on most UNIX-like OS's as-is.

Thunder cRIO Tools should produce binaries that work with both the 4-slot cRIO-FRCII and the older 8-slot cRIO-FRC (though 8-slot support has not yet been tested - we'd love to hear your experiences!)

Installing the Toolchain#

Thunder cRIO Tools makes use of an external toolchain to compile your C++ programs to binary form. This toolchain needs to be downloaded and installed separately:
  1. Download the current version of the C++ cRIO Toolchain from our File Releases Page. The most recent version tested with Thunder cRIO Tools was "Beta 1".
  2. Install the C++11 Toolchain by executing the downloaded installer. The installer requires no user interaction other than accepting the license.

Installing Eclipse#

Thunder cRIO Tools runs as a plug-in in the Eclipse IDE. It is intended to use in an Eclipse installation that has been set up for C++ development with current-generation roboRIO controllers, so if you have an installation of Eclipse already working for roboRIO development you can skip this section and move on to installing the plug-in itself. If you do not presently have an Eclipse installation, you can follow the very detailed instructions provided by FIRST for current roboRIO development. This will yield an Eclipse installation you can use with both current roboRIO development plug-ins and Thunder cRIO Tools for legacy cRIO development. Here's a very short and abbreviated set of instructions as an alternative to the detailed instructions from FIRST which you can use instead if you like:
  1. Install a Java JDK from Oracle if you do not have one: http://www.oracle.com/technetwork/java/javase/downloads/index.html - Java is needed even though we are doing C++ development because Eclipse itself is a Java program. The current version of JDK 8 is recommended. Be sure to get the JDK and not the JRE. You can use x86 or x64 if you have a 64-bit Windows system; use x86 if you have a 32-bit system or are unsure.
  2. Download Eclipse from http://www.eclipse.org/downloads/ Eclipse "Luna" (version 4.4) is the latest version of Eclipse as of this writing and is the one Thunder cRIO Tools was developed for. Mars has also been tested by some users of this set of tools and they have reported success. Be certain to get the bundle for C/C++ Development!!! This is named "Eclipse IDE for C/C++ Developers" on their site. There is a choice of 32-bit and 64-bit downloads: The one you should choose depends on what version of the JDK you installed in the prior step:
    • If you installed the x86 version of the JDK, get the 32-bit Eclipse installer.
    • If you installed the x64 version of the JDK, get the 64-bit Eclipse installer.
    • In either case, we repeat: be certain to get the Eclipse IDE for C/C++ Developers bundle!!
  3. Eclipse comes bundled as a simple .zip archive. To install it, simply extract the ZIP file to some location on your computer. FIRST's instructions recommend the Windows Program Files folder, but you can use whatever location you like. You will run Eclipse directly from this location and may wish to create a shortcut in a more convenient location, such as on your desktop.

Installing Thunder cRIO Tools Plugin#

This step actually installed the Thunder cRIO Tools Plugin into your copy of Eclipse. Remember the toolchain installation is required for the plug-in to function so be sure to have installed it first!
  1. Launch Eclipse
  2. Click Help, then click Install new software
  3. Add the Thunder cRIO Tools Update Site to your eclipse installation by clicking Add. Enter the following in the "Add Repository" window:
  4. Click OK to add the new site.
  5. Check the box next to Thunder cRIO Tools
  6. Click Next
  7. Click Next again
  8. Review and accept the license information, then hit Finish
  9. You will be warned that the Plug-ins are unsigned. Click OK to accept this.
  10. Restart Eclipse when prompted.

Using Thunder cRIO Tools#

Using Thunder cRIO Tools feels very similar to using the FIRST-provided WPIlib plug-ins for roboRIO. Here we detail the main methods for developing C++ programs for cRIO using Thunder cRIO Tools.

Configure Team Number#

Configure your team number before proceeding. This tells Thunder cRIO tools how to contact your cRIO on the network.
  1. Go to Window->Preferences
  2. Select Thunder cRIO Tools from the left side.
  3. Enter your team number and click Apply

Creating a new Thunder cRIO Tools C++ Project#

To create a new Eclipse project for C++ development for cRIO, follow these steps:
  1. Open the C/C++ Development perspective using the quick-access buttons on the top-right or using Window->Open Perspective
  2. Go to File->New->C++ Project
  3. Provide a name for your project
  4. Expand the "Shared Library" folder in the left side of the window.
  5. Select "FRC cRIO Binary" from within that folder
  6. Click Next
  7. Customize the name of the include and source folders if you wish, then click Next
  8. Select the starting template you wish to base your new project on. Each choice is for a different robot base class and resulting framework upon which to base your robot code:
    • Simple Robot: Provides method stubs for each robot operating mode. You provide all control flow. This is analogous to the 2015 "Sample Robot" template and base class.
    • Iterative Robot: Provides method stubs that get called periodically during each operating mode. You do not need to create any control flow within these - they should execute quickly and return.
  9. Click Finish

A new project will be created with the sample template provided in a file named robot.cpp. You can edit this file to your liking and add additional files in the source folder to create your robot project.

Porting an old Wind River project into Eclipse using Thunder cRIO Tools#

There is presently no automated means by which to import a project from WindRiver's project format. To do so manually, do the following:
  1. Create a new Thunder cRIO Tools project in Eclipse as detailed in the previous section
  2. Copy all the .cpp and .h files from your old project folder into the new Eclipse project. You can do this by drag & dropping from Windows Explorer into the Eclipse Project tree in Eclipse. Be certain to put .cpp files in the src directory or directory underneath it!
  3. Remove or overwrite the template-provided robot.cpp

Building a Thunder cRIO Tools Project#

Once you have your project code in place, you can build it by right-clicking the project in the Project Explorer in Eclipse and choosing Build Project or using Eclipse's auto-build function. Either way you will end up with several files generated in a folder named cRIODebug. Within this, the file named <projectname>.so.out is the binary which will run on your cRIO.

Deploying Code to a Robot Using Thunder cRIO Tools#

Once you have a Thunder cRIO Tools project, you can deploy code to your cRIO using the built-in deployment tool:
  1. Build your project to produce a binary
  2. Right-click the project in the Project Explorer
  3. Go to Run As
  4. Select cRIO C++ Deploy
  5. Note that the IP address of the cRIO is determined by the team number you configured above!
  6. Note also that unlike 2015's roboRIO-based system, the cRIO uses static IP addresses not name lookups. Therefore your programming computer must have a static IP address set on the same network as your cRIO robot! This is something like 10.TE.AM.45 where 'TE.AM' are numbers derived from your team number (for example, team 2135 would use 10.21.35.45)

Other cRIO Information#

Base Image#

The cRIO must be imaged to provide the base operating system files and FRC-related frameworks. Thunder cRIO Tools expects that you are using a C++ compatible image from the 2014 competition year (image version 52). If your cRIO is running an older image, binaries produced by Thunder cRIO Tools may not run at all, or may fail randomly. FIRST is still distributing the Imaging Tool necessary for imaging a cRIO with the current 2015 FRC Update Suite (aka the NI Update), however the cRIO images themselves for C++ are not included in this update package. If you need to image your cRIO, follow these steps:
  1. If your system is not set up for roboRIO 2016 competition year development, then install the 2016 FRC Update Suite from FIRST and National Instruments by following the FIRST-provided instructions If you are already using this computer to develop for roboRIO and have the 2016 FRC Update Suite installed you can skip to the next step.
  2. Download the 2014 cRIO v52 image file from our file releases page
  3. On your computer, make the following folders if they do not exist (this is necessary because the imaging tool looks in this fixed location): C:\WindRiver\WPILib\cRIO_Images
  4. Place the v52 image ZIP file in the folder C:\WindRiver\WPILib\cRIO_Images. Do not expand the .zip file just copy it there.
  5. Run the imaging tool by going to "C:\Program Files (x86)\National Instruments\LabVIEW 2015\project\CRIO Tool" (if your computer is 32-bit, it will be in Program Files) and running FRC CRIO Imaging Tool
  6. Image the cRIO per the FIRST-provided 2014 instructions. Be sure to check the C++ option (even though it says WindRiver!)
  7. Once imaged you must re-deploy code to your robot using Thunder cRIO Tools.

Driver Station#

The cRIO's base image for C++ speaks an older version of the Driver Station <> Robot Controller network protocol than what the 2015/2016 roboRIO does. This means that the 2016 Driver Station Software presently distributed by FIRST does not work properly with any cRIO imaged with a 2014 image in the default configuration. There is an option in the 2016 version of the DS that allows you to configure the DS for use with pre-2015 cRIO images. See below on how to use it.

Configure 2016 DS to work with 2014 cRIO Image#

  1. Install/upgrade to the 2016 version of the DS. This is included in the 2016 NI FRC Update Suite (see FIRST-provided instructions if you have not already installed it).
  2. Run the 2016 DS Software
  3. On the Configuration tab, select the DS Protocols drop-down and choose 2014
  4. Note that this option will reset to the 2015-based default when the DS is closed and restarted!!

Using the 2014 DS Software#

As an alternative to using the configuration option for the 2016 DS that auto-resets, FIRST has allowed us to make available the 2014 version of the Driver Station Software for teams to use. Here are the steps to install and use it:
  1. Go to our file releases page and get the 2014 Driver Station zip file.
  2. There is no installer for this application -- just expand the .zip file to some location on your computer. Be sure to expand the entire .zip.
  3. Run the Driver Station exe in the expanded folder.
  4. Depending on your computer's installation history, you may be prompted to install the 2013 LabVIEW Runtime Engine. This is a necessary installation if you wish to run the older DS and don't already have this runtime engine. Follow the prompts and instructions shown on screen to install the 2013 Runtime Engine. Once this is done the old DS version will execute normally.
  5. Only use this older version of the DS with your cRIO-based robots!! Do not use it with the 2015 roboRIO-based robots as it will not function properly!

Troubleshooting#

If you encounter a bug using Thunder cRIO Tools you can open a bug in our tracker. Click Trackers at the top of this page.