This repository contains custom FIRST Tech Challenge (FTC) robot control code written for the org.firstinspires.ftc.teamcode package. It includes:
- A timed Autonomous OpMode (
ChickenAuto) - A tank‑drive TeleOp OpMode (
TankDrive_TeleOp) - The FTC SDK iterative OpMode base class (
OpMode.java) for reference
The code is designed for use with the standard FTC SDK and REV Robotics Control Hub/Expansion Hub hardware.
teamcode/
│
├── chicken.java # Autonomous OpMode
├── Silver.java # TeleOp OpMode (Tank Drive)
└── OpMode.java # FTC SDK iterative OpMode base class (reference only)
chicken.java implements a simple timed autonomous routine named ChickenAuto.
- Four‑motor tank‑drive configuration
- Shooter motors included for safety shutdown
- Drive motors use BRAKE zero‑power behavior
- Shooter motors use FLOAT zero‑power behavior
- Helper methods for clean power control:
setDrivePower(left, right)stopAll()
- Hardware is mapped and configured
- All motors are stopped for safety
- Robot drives forward at 40% power for approximately two seconds
- Robot stops and reports status through telemetry
This OpMode is intended for basic autonomous movement and early testing.
Silver.java implements a tank‑drive TeleOp with ramping, deadzones, slow mode, and shooter/servo controls.
- Tank drive
- Left stick controls left motors
- Right stick controls right motors
- Deadzone filtering to prevent drift
- Slow mode (left bumper) limiting power to 40 percent
- Ramp smoothing to prevent sudden changes in motor power
- Adjustable tuning constants for maximum power, slow mode, deadzone, and ramp rate
- Two shooter motors (
DcMotorEx) - Controlled by gamepad triggers:
- Left trigger activates the primary shooter motor in reverse
- Right trigger activates the hex shooter motor forward
- Standard servo used as a continuous‑motion mechanism
- Button‑based control:
Xsets reverse positionBsets forward position- Default position is 0.5 (stop)
- Runtime
- Left and right drive power
- Slow mode status
- Shooter motor power levels
- Servo position
This OpMode is designed for smooth, predictable driver control with safety and consistency in mind.
Included for reference, this file is the FTC SDK's iterative OpMode base class. It defines:
- Lifecycle methods (
init,init_loop,start,loop,stop) - Gamepad update handling
- Telemetry update behavior
- Runtime tracking
- Internal safety and threading behavior
Your TeleOp (Silver.java) extends this class, while your Autonomous OpMode (chicken.java) extends LinearOpMode.
The following configuration names must match the FTC Robot Controller configuration:
| Component | Configuration Name |
|---|---|
| Left Front Drive Motor | left_front_drive |
| Left Back Drive Motor | left_back_drive |
| Right Front Drive Motor | right_front_drive |
| Right Back Drive Motor | right_back_drive |
| Shooter Motor | shooter_motor |
| Shooter Hex Motor | shooter_hex_motor |
| Servo | servo |
- Place these files in your FTC SDK project under:
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ - Open the project in Android Studio
- Build and deploy to the Control Hub or Robot Controller phone
- Select:
- ChickenAuto under Autonomous
- TankDrive_TeleOp under TeleOp
- Derrick Richard
- Emma Aldrige
Liscensed under the MIT License