Before You Start AS
This page is the starting point for a team that is beginning directly in Android Studio. It describes the Control System setup that the rest of this tutorial assumes, points to the documentation a Java team needs alongside it, and gives a checklist to work through before writing any code.
You do not need to have completed the Blocks or OnBot Java tutorials first.
Supported Control System Setup
This tutorial is written for the officially supported setup:
a REV Robotics Control Hub as the ROBOT CONTROLLER, and
a REV Robotics Driver Hub as the DRIVER STATION.
Important
Smartphones are not officially supported. They are legal to use in competition, but a team who uses one is responsible for all of their own testing and troubleshooting. Only the REV Control Hub and the REV Driver Hub are officially supported.
Where a page in this tutorial describes more than one setup, follow the Control Hub and Driver Hub instructions unless your team is using one of the smartphone setups below.
Smartphone Setups
Two smartphone setups appear throughout the Control System documentation. Both are covered by the same pages this tutorial links to, in sections labeled for smartphones:
A smartphone ROBOT CONTROLLER connected to a REV Robotics Expansion Hub. This setup needs extra steps that a Control Hub does not: renaming the phone, placing it in airplane mode with Wi-Fi on, pairing it to the DRIVER STATION, and enabling Developer Options so Android Studio can install the app onto it.
A smartphone DRIVER STATION in place of a Driver Hub. This setup needs the phone renamed and paired, and needs a Micro USB OTG adapter cable to connect a gamepad.
Note
A Control Hub has Developer Options enabled from the factory, so teams using the supported setup can skip the phone-only preparation steps.
Documentation You Will Need
Read or bookmark these before working through the rest of this tutorial. They are the pages that describe the hardware side of the Control System, which Android Studio itself does not cover.
Control System Introduction – what each component of the Control System does.
Required Materials – the hardware needed to complete this tutorial.
Computer Requirements – the laptop specifications recommended for running Android Studio.
Configuring Your Android Devices – installing apps, updating firmware, and pairing the DRIVER STATION to the ROBOT CONTROLLER.
Connecting Devices to a Control or Expansion Hub – wiring power, motors, servos, and sensors to the hub.
Configuring Your Hardware – creating the robot configuration file from the DRIVER STATION, which is how your OpMode finds each device by name.
Managing a Control Hub – renaming the Control Hub, changing its password, and updating Hub firmware.
Managing a Driver Hub – renaming the Driver Hub and updating the DRIVER STATION app.
Updating Components of the Control System – keeping the Control Hub OS, Driver Hub OS, and apps current.
Before Writing Code
Work through this checklist first. Each item links to the page in the documentation that covers it.
Check |
Where it is covered |
|---|---|
The Control Hub is wired to a 12V battery through a REV switch, and any Expansion Hub, motors, servos, and sensors are connected. |
|
The Control Hub and Driver Hub have been renamed to match the team number naming requirements in the Competition Manual. |
|
The Driver Hub is paired to the Control Hub, and the DRIVER STATION app shows the ROBOT CONTROLLER as connected. |
|
A robot configuration file has been created, saved, and activated from the DRIVER STATION, and each device name matches the name your OpMode will use. |
|
The Control Hub OS, Driver Hub OS, Hub firmware, and the DRIVER STATION app are up to date. |
|
Android Studio is installed and the |
Installing Android Studio, Downloading the Android Studio Project Folder |
The |
|
A USB Type C cable connects the laptop to the Control Hub’s Type C port, and Android Studio lists the hub as an available deployment target. |
Important
Android Studio builds and installs the entire ROBOT CONTROLLER app, replacing the one on the Control Hub. The app it installs must be compatible with the DRIVER STATION app on the Driver Hub, so update both from the same season’s release.
Note
This tutorial deploys the app over the USB Type C connection described above. The Control Hub also broadcasts a Program & Manage Wi-Fi network, used by the Blocks and OnBot Java tools and described in Connecting a Laptop to the Program & Manage Network.