Lesson: The FTC SDK Library

Overview: 
Explore the purpose and content of the FTC SDK Library.
Objectives: 

Understand what the FTC SDK Library is and how to use it to interact with robot hardware.

Content: 

The FTC SDK Library is a library of classes that allow your programs to access and control all aspects of the Tetrix robot control system and the hardware devices attached to it. This library is the API for the control system and robot hardware. The library is included in the FTC SDK. You can access the library with the following import statement in an OpMode class:

com.qualcomm.robotcore.<item_path>;

This provides access to the highest level of the library and all of the hardware and software classes are divided up into lower level items. you will need to import the items you need in your OpModes. All OpModes need the following import to make  the base opmodes class available for your OpMode to extend:

com.qualcomm.robotcore.eventloop.opmode.OpMode

or

com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

Another import you will always need is for the robot hardware classes:

com.qualcomm.robotcore.hardware.*;

Remember that the trailing * imports all classes in the hardware item. You can import all of the hardware classes or just the specific classes you intent to use. Either way is valid.

The documentation for the FTC SDK Library is very important to read over and get a basic understanding of what classes are available for your use. The documentation is located in the FTC SDK install directory (ftc_app-master-n.n) in the sub directory doc.javadoc. Click on the file index.html to display the documentation in your browser. The doc is in web format so you must use a browser to view it. You should create a bookmark the index.html file. Don't forget to update this bookmark when installing new versions of the SDK.

The doc directory also contains a sub directory called tutorial. This directory used to contain useful documents describing various aspects of the robot control system. These items are now located online in github attached to each release of the FTC SDK.

Of particular interest is FTC_SDK_UserMan. This document is an extensive description of the Tetrix/FTC robot control system and the software programming environment. While it overlaps our lessons, it provides a lot of detail and is a great supplement to our lessons. It is highly recommended that you at least skim this manual. Do note that the document may be out of date in some areas but is still quite helpful. An online version of the javadoc is also associated with each release.

Don't forget the example code that is included in the SDK in the FtcRobotController\java folder of the SDK project.

 

Navigation: