Skip to content

File Structure

  • Lesson
  • 2 min read
  • 6 of 6 in this chapter

Setting up your file structure

Let's finally jump into the technical part of programming your FTC robot. When it comes down to programming our OpModes, Android Studio and OnBot have slight differences. However, when it comes down to how the files are structured, or the hierarchy, that's where they differ. You can read about the differences for your preferred editor below.

Android Studio

In Android Studio, once you let the project load up, your screen will be divided into two parts. On the left, you will see the hierarchy inside your folder.

TeamCode

You should see a TeamCode folder. Open it, and navigate via this path: TeamCode > java > org.firstinspires.ftc.teamcode.

It's in this folder where we will create all of our files. Just right-click, click New > Java Class, give it a name, and you are good to go.

FtcRobotController

You should also see a FtcRobotController folder. This is where the samples from FIRST are stored. If you follow this path, you should see them all: FtcRobotController > src > main > java > org.firstinspires.ftc.robotcontroller > external.samples

This folder contains all of the code that FIRST provides to you. This is extremely helpful when you want to try some cool things, whether it be playing sounds, checking out different sensor implementations, or even vision.

OnBot

Everything is much easier in OnBot. Make sure you are in the org.firstinspires.ftc.teamcode folder, and just click the + button at the top to create new OpModes/files.

Templates/Samples from FIRST are also included within the menu that pops up. As long as you choose how it's set up and which folder it goes within, it all just works.

What next?

In the next chapter, we're going to get started with programming our first TeleOp program.