Getting Started - Programming
MORT U
The IDE
The Integrated Development Environment (IDE), sometimes known as the editor is the programmers way of editing and compiling their code. This is where the programmers will do most of their work.
On this project, the default IDE that everyone needs to know is the Eclipse IDE. It's pretty much the standard IDE that has a wide array of useful features for editing a number of different languages.
Another IDE that the team has enjoyed is IntelliJ IDEA, which has some appreciated features that Eclipse lacks by default, such as integrated version control. However, that can be remedied by plugins for Eclipse, such as EGit.
There are long standing battles as to which IDE is better. However, as most of the tutorials available for FRC are given in Eclipse, everyone needs to know Eclipse.
- Installing Eclipse (obsolete)
- Installing and Using IntelliJ IDEA (optional)
Java
Java is the language we use primarily to program the FRC robots. It is a general purpose programming language that can do almost any variety of tasks. It works hand-in-hand with WPI Lib to control the robot.
Or manually with another IDE:
See the Java page to learn more about how we use Java.
The RoboRIO
The RoboRIO is a small embedded computer designed to control all functions on the robot, providing a variety input/output (I/O) facilities.
It is the main device that allows us to interface with the FRC Field Management System (FMS, sometimes known as The Field), taking commands such as the Start Autonomous signal or the Start Teleop signal. The RoboRIO allows us to read our sensors and control our motors and pneumatics. It can also interface with auxiliary on-board computers, such as the Kangaroo, and communicates with the Driver Station via WiFi, or a laptop for programming via Ethernet.
The RoboRIO includes built-in ports for inter-integrated circuits (I2C), serial peripheral interfaces (SPI), RS232, USB, Ethernet, pulse width modulation (PWM), and relays to quickly connect the common sensors and actuators used in robotics. The controller features LEDs, buttons, an onboard accelerometer, and a custom electronics port. It has a dual-core ARM real-time Cortex‑A9 processor and customizable Xilinx FPGA.
You can use LabVIEW on the Driver Station to program the onboard processor, though we usually use a laptop and download our software via an Ethernet cable.
Default username and password for the RoboRIO is admin with a blank password. DO NOT CHANGE IT.
See more on the RoboRIO page.
WPI Lib
Java may be the main language that we use to control the robot, but it does not provide an easy to use set of interfaces to do so on its own. The good folks at Worcester Polytechnic Institute (WPI) have, over the years, developed the low level code and higher level interfaces that provides a fairly comprehensive interface to the hardware provided by the RoboRIO, with mechanisms of control that we find useful.
The WPI Robotics library (WPILib) is a set of software classes that interfaces with the hardware and software in your FRC robot’s control system. There are classes to handle sensors, motor speed controllers, the driver station, and a number of other utility functions such as timing and field management. In addition, WPILib supports many commonly used sensors that are not in the kit, such as ultrasonic rangefinders.
LabVIEW and the Driver Station/Classmate
(TBD more on the LabVIEW, Dashboard, Driver Station)
- Getting Started with the LabVIEW and the Driver Station
- Smart Dashboard The Smart Dashboard The SmartDashboard typically runs on the Driver Station computer and will do two functions:
- View robot data that is displayed as program status as your program is running.
- View sensor data and operate actuators in Test mode for robot subsystems to verify correct operation.
Version Control/Configuration Management - with Git
Version Control is a subset of Configuration Management and Change Control. Some people think of version control as a fancy backup, a software repository that allows you to rollback changes that broke things. It is that, but it's much more powerful and important. Configuration Management involves controlling what goes into a build - identifying what features are wanted and ready, and controlling the releases so that only the right code goes in. You don't want to include code that doesn't fit with the product that needs to be delivered. You also need to be able to reproduce an important, working, build that occurred at a previous time.
Mostly, we use Git to save and share our code, but also for Change Control - preventing unwanted changes from disrupting an important build. For example, perhaps we're working on some advanced autonomous code that is not ready for Week 1, but we still want it saved in the repository and shared. But we have to deliver a build for Week 1 that works. That advanced but not yet ready code can go into a different development branch that won't get pulled into the main product branch.
Not sure this is the best link, but does appear useful. Getting Started with Git. See Chapters 1 and 2.
Day 1 Installs
Eclipse, Java, WPILib (Install Eclipse and the FRC Update Suite)- Installing and Using IntelliJ IDEA
IntelliJ (Integrated Development Environment (IDE))
Note: Eclipse is being dismissed as the go to IDE for FRC. They want to move to MS Visual Studio Code. We do not. However, all of the current examples FRC provides is with Eclipse, and they are expected to move them to MS VS Code. This leaves Benny in a bind because he has to provide ALL of the examples. - Get JDK 8
- Get Java
- WPILib/FRC Plug-in for IntelliJ ?? (TBD)
- Git (Source Control. Install Git for the platform you are using.)
- Tortoise Git (GUI for Source Control) Windows only, or
- Git Extensions (A better GUI for Source Control) Windows (Maybe Mac and Linux with Mono .NET framework emulator)
Also see:
- 2019 Programming Build Season Installs which has information for FRC RoboRIO updates.