🔨 Build the FtcRobotController in a development container on practically any device.
Android Studio is the recommended IDE for developing with the FTC SDK, with OnBot Java being an alternative when Android Studio isn't available.
However, OnBot Java requires the physical robot to be present in order to build the SDK, and lacks version control.
The purpose of this project is to provide a development container that runs in the cloud, allowing programmers to build their projects anywhere - with or without the robot.
Additionally, the development container is configured to run on the latest release of the Ubuntu distribution, providing access version control and additional software packages.
Note This is not a robot simulator.
Nor does it provide a method of installing the robot controller APK, though you could try to download it and manually push to the phone or Control Hub.
Note This is a guide for using the development container on GitHub Codespaces.
If you are able to run it on another platform, consider submitting a pull request!
Codespaces documentation can be found here.
- Prerequisites:
- A GitHub account.
- On this repository's page, click on [
<> Code ⯆
]. - Navigate to [
Codespaces
]. - Create a Codespace on main.
- Initial configuration usually takes a couple minutes.
- If configuration fails, you will be prompted to view a creation log.
- Please submit an issue with relevant details from this log.
- You can access your created Codespaces by navigating to Codespaces menu from the GitHub dashboard.
- Subsequent startups of a Codespace will take under half a minute.
- Initial configuration usually takes a couple minutes.
- Expand the
FtcRobotController
directory and navigate toTeamCode/.../teamcode
, or delete the pre-cloned project and clone your own repository.- By default and for security, Codespaces are prevented from accessing the contents of private repositories aside from the one they're created in.
- See here for how to add permissions.
- Open the README file in
teamcode
or create an OpMode. - Use the shortcut CTRL + SHIFT + B, or the build shortcut, to run the build task.
- Be sure that a file in the project to be built is actively open in the Codespace editor (VSCode), as the build task uses this information to determine which project to build.
- The initial build and configuring process will take a couple minutes.
- Subsequent builds will be under half a minute.
- If the build fails the first time due to the Gradle Daemon "disappearing unexpectedly", try again.
Note Codespaces is a free service, but has usage limits. You can view your usage here.
You will not be charged by default if your usage exceeds the amount allotted, assuming no payment information is provided for your account.
If if a GUI is preferred for building, create your Codespace on the gradle-extension branch.
Please read the README in this branch for instructions, clarifications, and limitations.
.devcontainer/Dockerfile
- The platform-tools and tools Android SDK packages are not installed by default. Uncomment their respective lines here and rebuild the container to add them.
.devcontainer/post-create-env.sh
- Configure additional environment variables here, such as adding the path of the packages above to PATH.
build.sh
- The build script. By default, Gradle is set to debug build the TeamCode
of the currently active file in the editor using at most two worker threads. When building a module not named TeamCode
, that module's name should be used in place of TeamCode
in the build script and in .vscode/tasks.json
.
- Build performance can possibly be improved by disabling the following extensions:
- Debugger for Java
- Language Support for Java...
- Maven for Java
- Project Manager for Java
- Test Runner for Java
- If Codespace storage becomes an issue, run the following command to clean the build:
cd [dir] && ./gradlew clean
(replace [dir
] with the folder name of the project) or truncate any git commit history to include only the most recent commits. - Stop the Codespace when it's not being used to prevent incurring unintended usage (click Codespaces in the bottom left corner). Codespaces will automatically timeout after thirty minutes of inactivity.
- To update the container, click the sync button near the bottom-left corner (ensure that the editor is opened to this README file when doing the latter so this container's repository is focused instead of the robot controller's), or pull the latest commit with
git pull
.
Please consider improving this project by submitting an issue or pull request!