Robot Code for Team 401's robot, PHIL, for the 2017 season FIRST Steamworks. Code in this repository is written in Kotlin and Java, and is a command based system.
Code is divided into several sub-packages, each with a specific purpose, like to hold code for each subsystem, component, etc. Each package and its specific function are explained below.
Contains the robot's main class files, constants, and controls.
Contains the code for autononmus which includes AutoModes, which are a series of actions run for each strategy we run during auto, and actions, which are small steps that each auto mode will run, such as driving, turning, shooting, etc.
Code for USB cameras connected directly to the RoboRIO, and makes it easy to switch between two cameras on the dashboard.
Contains classes for components that are used more than once on the robot, or are better represented as an object in code rather than an entirely separate subsystem.
Periodic tasks that are run with the LoopManager class in the lib package, like calibrating the gyro or updating the dashboard display.
Each subsystem on the robot is represented into one class per subsystem in this package. Classes here use the singleton concept, where there is only one instance of each "subsystem", or class. Each subsystem uses an enum to track its state, and will update its components or controllers to match its current state. Instead of passing around the instance of a subsystem, you can get the instance of each one in Java by getting the reference to the object with the final field INSTANCE, or in Kotlin by treating the class as a static class.
Contains classes that can and should be reused each year, such as code for common interfaces, utility classes, sensors, crash tracking, and math helpers.
How to write or edit code in an IDE:
- First, fork, clone, or download the repo through your favorite method (command line, git client)
- Install the Java 8 JDK if it's not installed already.
./gradlew (your ide)in terminal for mac/linux or
gradlew (your ide)in CMD on windows. (Use
ideafor IntelliJ and
- Double click the 2017-Robot-Code.ipr to open in IntelliJ or import the directory as a project in Eclipse.
NOTE: Eclipse users will need to install a plugin so that they can compile .kt files.