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. Tetrix robots can use two different control systems, the older one by Moder Robotics (MR) and the newer system by REV Robotics (REV). 

Here is a refresher (watch first 4:30) on the MR hardware environment. Here is a diagram of the MR system hardware components and a diagram of the basic wiring of the MR control system.

Here is a diagram of the REV system hardware components. Here is a video discussing the wiring of the REV components.

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) 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 (adding your robot programs into the controller app). This source code is called the FTC SDK.

The procedures for installing the software tools you need are discussed in this video. Links to the components discussed in the video are below. Review the notes below before starting.

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. The public JRE is the same as the Java runtime installed above. You could skip the Java runtime install above and include the public JRE during the SDK install. Either way works.

Here is a link to download the FTC SDK on github. On the github page for the SDK, click the green Clone or Download button. Then click download zip file. As a suggestion, create a folder called FTC Java Projects in your My Documents folder and extract the FTC SDK (ftc_app-master folder) from within the zip file into the FTC Java Projects 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. You can find the version by scrolling down on the github page to the Release Information section. The version of the SDK will be shown there. If you install a newer version of the SDK, locate the Team Code folder inside the old ftc_app-master-n.n folder with Windows Explorer and copy your code to the Team Code folder in the new version folder.

Here is a link to download Android Studio. The AS install process involves several long downloads so do the AS install and the project import (below) on a fast internet connection.

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 select the folder (and click Open) 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 by the project and flag any missing components as errors along with a link you can double click to install the missing item. This scan/download process can take a long time. There can be a number of install operations flagged during the initial Gradle sync. Be patient and complete each flagged install. After the downloads complete, Gradle will run for some time to complete the import. Watch the status bar at the bottom of the AS screen to see when all Gradle activity ceases. When done you can minimize the status display area at the bottom of the screen with the minimize button just right of the gear icon on the status display area top bar.

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.

Android Studio includes a feature called "Instant Run". Some FTC teams have had problems with this feature interfering with deployment to the robot controller phone. It is recommended that you disable instant run by opening File->Settings->Build->Instant Run, uncheck the first box, then click Ok.

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.

If you are using Modern Robotics control hardware, 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.

If you are using the REV Robotics control hardware, here is a documentation package by REV that discusses using the Expansion Hub controller.

 

 

Navigation: