Lesson: Introduction

Introduction to Java programming for the Tetrix platform.

Understand the main concepts of the Tetrix robot control system hardware and software.


This lesson is the first in the "off ramp" unit for Tetrix programmers. This unit contains a detailed exploration of writing Java programs for the control system used on Tetrix based robots. Don't forget to complete the rest of the Java curriculum starting with Unit 12.

We have been learning a lot about the Java programming language. Now its time to explore how we actually write, compile and deploy Java programs to the robotics control system.

Tetrix based robots use a far more complex control system than the EV3 (FLL) based robots. At the FTC level robots engage in autonomous activity, meaning the robot is not under the control of a human, just like EV3 robots. However, autonomous activity is a relatively small part of the match that is played in competition. The larger portion of match time is teleoperated activity, where the robot is under remote control by human operators. As such, the control system consists of two hardware devices, a robot controller device and a driver station device. The two devices are connected (paired) over a WiFi Direct network. With the Tetrix system, the two devices are Android based cell phones.

The driver station cell phone is fairly straight forward. The software for the driver station is provided by FIRST and is not modified by you. Xbox game controllers plug into the driver station phone and are the input devices for robot control.

The controller cell phone is more complex. This phone is attached to the robot and interfaces with controller hardware that allows the phone to connect to the various robot hardware devices like motors and sensors. You write the software that runs on the controller phone and operates the robot with input from the driver station phone's game controllers.

You can write programs for Tetrix robots with block based programming tools or with Java (discussion). This curriculum only deals with Java. Java programs can be developed on a Windows PC using the Android Studio (AS) IDE or directly on the controller phone using the OnBot Java IDE. The Java exercises in this curriculum will work with either AS or OnBot Java.

The software tools we will be using to write Tetrix robot control programs are:

  • Driver Station phone program
  • Robot Controller phone program
  • Interactive Development Environment (AS or OnBot)
  • Robot Control program SDK from FIRST for FTC (AS or OnBot)

We will discuss each of these tools and how to install them in detail in the following lesson.

The Driver Station and Robot Controller phone software is provided by FIRST and downloaded from Google Play. You connect the phones to the internet and download the appropriate program to each phone. 

An Interactive Development Environment (IDE) is a tool that makes it easy to create, compile and deploy programs to devices. Because the robot controller is an Android cell phone, the control program is actually a phone application.

Android Studio (AS) is similar to Eclipse or Visual Studio but is optimized for creating phone applications. There are plugins to AS supplied by FIRST that customize AS for use in developing Tetrix control programs.

OnBot Java allows you to write Java programs by using a web browser to connect to a limited Java IDE hosted on the controller phone.

The final piece is the FTC SDK provided by FIRST. Since the robot control program is an Android phone application, FIRST has provided a base phone application which handles the details of phone applications and includes the libraries (API) needed to access robot hardware and communicate with the Driver Station phone. The design of this base application allows you to modify the application by simply adding your own classes (called OpModes) to the base application. The base application hides the details of Android phone applications so you can focus on programming your robot. The base phone application does not do any robot control, that is the responsibility of the classes you add. This base phone application is delivered to you as an Android Studio project that compiles into the phone controller application. This project, for the base phone application, is referred to as the FTC SDK.

The controller application, wether downloaded or compiled by AS, contains an embedded version of the FTC SDK for use by OnBot Java programs.