Lesson: Getting Started

Overview: 
Explore the procedures to install the software tools needed to develop Java programs for Tetrix robots.
Objectives: 

Complete the installation of all of the software tools needed to program Tetrix robots with Java.

Content: 

This course will not delve into Tetrix hardware details or discuss how to build the physical robot. It is assumed you will learn about these topics elsewhere. However, here is a refresher (watch first 4:30) on the Tetrix hardware environment. Here is a diagram of the Tetrix system hardware components and a diagram of the basic wiring of the control system.

As we discussed earlier, the Tetrix control system consists of two cell phones, a robot controller phone and a driver station phone. You download the driver station phone application (app) and a test robot controller app from Google Play. Search Play for "FTC Robot". You do not modify the driver station app. You can also download a demo version of the controller app onto the controller phone. This allows you to get some familiarity with the two apps and how the controller phone is configured to know about the specific hardware devices (motors, sensors) that are part of your robot. Here is a lesson (watch from 14:00 to 28:12) on these two apps showing how to operate them.

The source code for the robot controller app is available to you to download and install into Android Studio (AS). This is now you create your own robot control programs, by modifying this FIRST supplied controller app. This source code is called the FTC SDK.

The procedures for installing the software tools you need are discussed in this lesson. Links to the components discussed in the video are below.

Here is a link to download the Java runtime.

Here is a link to download the Java SDK. Download the i586 file for 32-bit Windows, x64 for 64-bit Windows. When installing, you only need the Development Tools, you can X out Source Code and Public JRE.

Here is a link to download the FTC SDK on github. As a suggestion, create a folder called FTC Java in your My Documents folder and extract the FTC SDK (ftc_app-master folder) into the FTC Java folder. Then rename that folder to include the FTC SDK version, ie: ftc_app-master-3.4. This will allow you to keep older versions of the SDK and safely install new versions. You should not overlay an existing version with a newer version. Note, when installing a newer version, locate the Team Code folder inside the old ftc_app-master-n.n folder and copy your code to the Team Code folder in the new version folder.

Here is a link to download Android Studio.

As shown in the video, at the end of the AS install process,  you will be prompted to tell AS what project to start with. You will want to select Import Project (Gradle) and give the folder where you installed your FTC SDK (ftc_app-master-n.n) project. At this point AS will use Gradle to import and analyze your project.

Gradle is the name of the tool used with AS to compile and deploy the robot controller app. On first import of the controller project, Gradle will scan the project and determine what Android components are needed and flag any missing components as errors along with a link you can double click to install the missing item. This scan can take a long time. There can be a number of install operations flagged during the initial Gradle sync. Some of these operations can take a long time to complete. Be patient and complete each flagged install.

After Gradle processing completes, AS will show a blank editing area on the right and the project navigation window on the left. AS may also show a single blank editing area. On the vertical bar left of the navigation window or editing area, select Project. Then on the tabs at the top of the project window, in the view drop down list, select Android. This will give you the simplest view of the project. You should see two main folders, FtcRobotController and TeamCode. FtcRobotController contains the low level FIRST provided components of the robot controller app. You will not need to modify any part of this code. However, the FIRST provided example code is located here. You can open the folders to java then org.firstinspires.ftc.robotcontroller (a package) then folder external.samples to see the example code. This example code is a very valuable resource to learn how to program many robot functions and use various sensor devices once you have completed this course.

The TeamCode folder is where you will put all of your source code. Open that folder and then java and then org.firstinspires.ftc.teamcode which is the folder (also the package) where your code will be.

One final installation step: locate the platform-tools folder in the Android SDK folder, which by default is located at C:\Users\<yourusername>\appdata\local\Android\sdk. From platform-tools copy the files adb.exe, AdbWinApi.dll and AdbWinUsbApi.dll to the C:\Windows folder.

Note: If you are in a class room or other situation where multiple users, with different Windows user names, will share a single PC to work on this curriculum, please see these instructions on Android Studio shared by multiple users on the same PC.

We will learn more about how to use Android Studio in a later lesson.

A great resource to use while working with the FTC platform is the FTC Technology Forum.

Finally, here is a lesson package by Modern Robotics that explores the hardware components in great detail. You don't need to explore this now but you may wish to look at this material later to gain much more detailed information about the hardware components, how they work and what you can do with them. When you visit the Modern Robotics Education web site, you will be prompted to login. Click on guest access below the login boxes to access the site without registering.

Here is a documentation package that discusses using the new REV Robotics Expansion Hub controller instead of the Modern Robotics controllers.

 

 

Lesson navigation: