Lesson: java ev3 Introduction

Overview: 
Introduction to Java programming for the Tetrix platform.
Objectives: 

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

Content: 

This lesson is the first in the "off ramp" unit for Tetrix/REV programmers. This unit contains a detailed exploration of writing Java programs for the control system used on Tetrix/REV 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/REV based robots use a far more complex control system than the EV3 (FLL) based robots. In FTC game play 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/REV 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 connects to the REV Expansion Hub hardware interface that allows the phone to connect to the various robot hardware devices like motors and sensors. The programmer writes an Android phone app that runs on the controller phone and operates the robot with input from the driver station phone's game controllers.

Starting with the 2020-21 FTC season, a new controller option, the REV Control Hub is available. The Control Hub eliminates the robot controller cell phone by integrating the Android execution environment into the Expansion Hub. The  driver station phone and the Control Hub are connected (paired) over a regular WiFi network instead of WiFi Direct. Given that the robot controller can now be either a cell phone or the Control Hub, and they mostly work the same, we are going to refer to them generically as the  robot controller device and discuss differences between them only when needed.

You can write programs for these 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 device 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/REV robot control programs are:

  • Driver Station phone program
  • Robot Controller device 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 phone software is provided by FIRST and downloaded from Google Play. You connect the phone to the internet and download the appropriate program. You can download a sample robot controller phone app as well but the point of all this is to write your own controller app. There is no downloadable sample for the Control Hub. 

An Interactive Development Environment (IDE) is a tool that makes it easy to create, compile and deploy programs to devices. 

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

OnBot Java is a web browser based IDE hosted on the controller device that allows you to write Java programs directly on the controller device.

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 application which handles the details of Android 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 applications so you can focus on programming your robot. The base application does not do any robot control, that is the responsibility of the classes you add. This base application is delivered to you as an Android Studio project that compiles into the controller application. This project, for the base application, is referred to as the FTC SDK.

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

 

Navigation: