Skip to content

Commit

Permalink
removed references to OI.java
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylerUva committed Oct 1, 2021
1 parent c28510d commit 8a52df4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
18 changes: 6 additions & 12 deletions docs/basics/wpilib.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,15 @@ Making FRC Programming Easy

- In FRC programming our main class is **Robot.java** and all other classes (command files and subsystem files) must be loaded from **Robot.java** either directly or indirectly
- !!! Example
**Robot.java** loads **OI.java**, **OI.java** loads **DriveForward.java**.
- All **subsystem** files must be added to **Robot.java**’s auto-created `#!java robotInit()` method.
- This loads our **subsystems** into the code and allow its public methods to be useable by other files such as commands later by typing `#!java Robot.nameOfSubsystem.desiredMethod();`
**Robot.java** loads **RobotContainer.java**, **RobotContainer.java** loads **DriveForward.java**.
- All **subsystem** files must be added to **RobotContainer.java**.
- This loads our **subsystems** into the code and allow its public methods to be useable by other files such as commands later by typing `#!java RobotContainer.nameOfSubsystem.desiredMethod();`

***

### New Project Files

- When creating a new command based robot project, the following classes (files) will be created:
- **Robot.java** - The main class of the robot which is run when a robot boots up.
- **OI.java** - This class binds our **commands** to a physical operator interface such as a joystick or controller.
- This file is already in `#!java robotInit()` by default so classes called here will also be loaded by the program
- **RobotMap.java** - This class is used to hold all the ports or ID numbers of sensors or devices connected to the robot and assign them a variable name.
- This provides flexibility for changing wiring, makes checking the wiring easier, and significantly reduces the number of magic numbers floating around.
- **ExampleSubsystem.java** and **ExampleCommand.java** are auto-created examples.
See [Default Project Contents](../programming/new_project.md#default-project-contents)

***

Expand All @@ -129,6 +123,6 @@ Making FRC Programming Easy
- Command based robots are broken down into **subsystems** and **commands**
- **Subsystems** define what the robot is made of and what it can do while **commands** actually tell the robot to do those things
- All classes must directly or indirectly connect to **Robot.java**.
- All **Subsystems** must be added to **Robot.java**’s `#!java robotInit()`
- All **Subsystems** must be added to **RobotContainer.java**
- **RobotMap.java** holds port numbers and IDs accessible throughout the program by typing: `#!java RobotMap.NameOfMotor()`
- **OI.java** connects our commands to physical controllers
- **RobotContainer.java** contains our publicly accessible instances of our subsystems. It also connects our commands to physical controllers.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The unofficial FIRST Robotics Competition Java Programming Tutorial.

!!! Info
Updated for the 2021 Season
Last updated: 10/30/20
Last updated: 9/30/21

**Disclaimer:** Some screenshots may have different colors, icons, more/less folders/files than you due to themes or personal settings. This is normal and should not impact the tutorial. If you still have any questions please contact us.

Expand Down
6 changes: 3 additions & 3 deletions docs/programming/new_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ Before we can start programing a robot, we must create a new project in Visual S

### Default Project Contents

<!-- TODO: Maybe remove this or combine it with the WPILib section -->

Newly created projects have many files within them. We only care about the contents within the **src/main/java/frc/robot/** folder. Everything else can be ignored at this point in the tutorial.

**Files in the robot folder:**
Expand All @@ -62,7 +60,8 @@ Newly created projects have many files within them. We only care about the conte
- **ExampleSubsystem.java**
- An example SubSystem
- **Constants.java** (new in 2020, replaces RobotMap.java)
- Used to map physical ports (digital if using the CAN bus) to variables in the code
- Used to map physical ports (digital if using the CAN bus) of sensors or devices connected to the robot and assign them a variable name to be used in other parts of the code.
- This provides flexibility for changing wiring, makes checking the wiring easier, and significantly reduces the number of magic numbers floating around.
- Can also be used to store generic constant values as variables in the code
- **Main.java**
- Used for advanced programming
Expand All @@ -71,6 +70,7 @@ Newly created projects have many files within them. We only care about the conte
- Used to declare our subsystem
- Used to create a connection between commands and Operator Interfaces (OI) such as Joysticks or buttons
- **Robot.java**
- The main class of the robot which is run when a robot boots up.
- Used to run special methods in the init and period phases of the auto, teleop, and disabled states

??? Example
Expand Down

0 comments on commit 8a52df4

Please sign in to comment.