Step 4: The parts
At the end of this step, you know each of robot 1’s parts. They are the drive, the folding intake with its
deploy servo, the flywheel with its squeeze feeder and the ramp, and the webcam that aims. For each part you know
its line in Robot.java, its numbers in Tunables.java, and the test that proves it.
Read only what robot 1 has. The docs’ Add to your robot section has a page for each kind of part. Robot 1 uses these pages: the intake, the launcher, the camera, and parts working together. It also uses one idea from the claw page: a servo with named positions, for its deploy servo.
Robot 1 has no lift, arm, claw, turret, lights, odometry or piece sensors. Skip those docs pages. Do not add them to robot 1’s code: robot 1 would break.
Try it missions: make the change, check it, then undo it with git restore TeamCode simulator (in the
octobots-2026-r1 folder). Never commit a mission.
Step 3 has the full rule and how to run a
test.
The drive
Section titled “The drive”Robot 1’s code: the drive line is in step 3. Below it is the robot’s size for the simulator:
// The chassis box (length, width with the wheels, height) and the whole robot's height, mm. est. chassisMm(432, 440, 80); heightMm(305);Learn it: Robot.java: The drive, attribute by attribute. Read each attribute of the drive line, and “A wheel turns the wrong way”.
Why robot 1 does it this way:
- A mecanum drive on goBILDA’s Strafer chassis. Mecanum wheels have angled rollers, so the robot strafes (drives sideways) with no extra part.
- No odometry (extra wheels that track where the robot is). Robot 1’s autos drive on the wheel encoders, with the Drive Tuner’s numbers. Skip Add odometry.
chassisMm(...)andheightMm(...)are for the simulator only. They are estimates (est.) until we measure robot 1. The simulator uses them to check the size rules.
Check:
r1-drive.sim: the robot strafes in a straight line.r1-motor-direction.sim: in Tune and check, the Motor Direction Check reverses the left side, and X runs only the front left wheel.r1-v1.sim: the robot fits the size rules, folded and deployed.
Try it (optional): in chassisMm(432, 440, 80), change the width 440 to 470 (wider than 18 in).
Run r1-v1.sim: it fails at a size check. Then undo it.
The intake and its deploy servo
Section titled “The intake and its deploy servo”Robot 1’s code:
// The deploy servo: pushes the folded intake over at START. optional(): the robot runs without it. // "intake_deploy" = the servo's name in the robot configuration. Its numbers: Tunables.IntakeDeploy. intakeDeploy = add(Positioner.servo("intake_deploy").part("gobilda-2000-speed").optional() .looks(Shape.arm().name("deploy_kicker").atMm(-120, -130, 150).sizeMm(50, 15, 15) .angle("stowed", 90).angle("deployed", 150).note("est."))); // "intake" = the motor's name in the robot configuration. Its numbers: Tunables.Intake. intake = add(Intake.motor("intake").part("gobilda-5203-117").holds(4) .looks(intakeArm, roller, leftSpinner, rightSpinner)); public static class Intake { // "intake" in the configuration public static double inPower = DEFAULT; // power taking pieces in, 0 to 1 (1.0) public static double outPower = DEFAULT; // power pushing pieces out (0.7) }
/** MEASURE: INIT stops until the Servo Finder gives these two numbers (a guess could break the servo). */ public static class IntakeDeploy { // "intake_deploy" in the configuration public static double stowed = 0.64; // intake folded (Servo Finder) public static double deployed = 0.5; // intake pushed over (Servo Finder) public static double travelSec = DEFAULT; // a full 0-to-1 move, seconds (servo's speed) }Learn it: Add an intake. Read “Robot.java: one line” and “A fold-out intake”. For the deploy servo, read Add a claw and other servo parts: it explains a Positioner (a servo with named positions) and the Servo Finder steps.
Why robot 1 does it this way:
- The intake is at the back. A 117 RPM motor turns soft tubing rollers (90 and 60 mm). Through miter
gears (gears that turn the motion through a right angle), it also turns the two spinners: 72 mm
Boot-Wheels that lie flat at the back corners. The spinners have no code
of their own. They are shapes of the intake (
leftSpinner,rightSpinner), so the simulator turns them with it. One is.reversed(), because the gears turn the two wheels opposite ways. - The shapes (
intakeArm,roller,leftSpinner,rightSpinner) are above the intake line. They are for the simulator only, and eachnote("est.")is an estimate. - The intake folds up to fit the 18 in start cube. Right after START, the deploy servo pushes it over,
and gravity drops it onto its stop.
Actions.deployIntakedoes it (see “Parts working together”, below). - The deploy servo is a Positioner with two positions,
stowedanddeployed. Their numbers come from the Servo Finder. If the Speed servo is too weak to push the intake over, use the Torque servo:part("gobilda-2000-torque"). .optional(): the robot also runs with no deploy servo in the configuration. Then put the intake down by hand before each run. With the intake down, the robot is too long for the start cube, so this is for practice only.- No
.onAtStart(): the deploy action starts the intake. - No
.stopsWhen(...). Robot 1 has no color sensors, so nothing counts the pieces.holds(4)only tells the simulator how many fit. The drivers count, and tap LB (intake off) at 4. Tunables.Intake: both powers stayDEFAULT.
Check:
r1-v1.sim: the intake starts folded, drops at START and stays down, the servo goes back tostowed, the robot fits the size rules, and the intake picks up a POLLEN.r1-no-deploy-servo.sim: with no deploy servo in the configuration, INIT goes on, the intake still runs, and it picks up a POLLEN.
Try it (optional): in simulator/scenarios/r1-v1.sim, add this line as the second line:
set tunable IntakeDeploy.deployed 0.6Run r1-v1.sim. The check for the arm at 220 fails. Why: the servo does not turn far enough to push the
intake over. Robot 1’s simulator robot file drops the arm only when the servo is below 0.535. Try 0.45:
it passes again. Then undo it.
The launcher and the feeder
Section titled “The launcher and the feeder”Robot 1’s code:
launcher = add(Launcher.flywheel("launcher", "gobilda-5203-6000").reversed() .feeder(Indexer.crServo("feeder_left").alsoServoReversed("feeder_right").part("gobilda-2000-speed") .reversed() // on the robot both wheels pushed the POLLEN out: reversed() turns both around .tunables("Feeder").optional().looks(leftFeedWheels, rightFeedWheels)) .feedWheelOutWith(intake) // the intake pushing out turns both feed wheels backward too .spinAtStart() // at speed from START and between shots, ready to fire (B switches it off) .looks(launcherSlide, flywheel) .shotAngle(75)); // 75° up from the floor, out of the front (the planned ramp; the built one is 53°) public static class Launcher { // "launcher" in the configuration public static double speedRpm = 3450; // TeleOp and autos 2-3 shot speed (auto 1 has its own; goBILDA had 2679) public static double stepRpm = 50; // speed change per D-pad press (library default 100) public static double readyBandRpm = 100; // "at speed" = this close to the target (library 60: at 3450 the wheel sat near 3429 and seldom fired) public static class Feeder { // "feeder_left" and "feeder_right" in the configuration public static double power = DEFAULT; // both wheels' power, -1 to 1 (1.0); below 0 = both turn the other way public static double feedSec = DEFAULT; // the most time the wheels run per shot (0.4): none goes = more public static boolean stopOnShot = true; // stop the wheels when the flywheel sees the shot (not in SPRAY) }The rest of Tunables.Launcher is below it in robot 1’s Tunables.java.
Learn it: Add a launcher. Read “Robot.java: one line”, “Tunables.java: its numbers” and “Find its numbers”.
Why robot 1 does it this way:
- The flywheel: one 96 mm wheel (
gobilda-hogback-96) on a 6000 RPM motor (gobilda-5203-6000). The motor turned the wheel the wrong way, so the line has.reversed(). - Two feed wheels, one on each side of the POLLEN.
feeder_leftandfeeder_rightare Speed servos set to spin (CR servos). Each turns stacked 48 mm Gecko wheels. They squeeze the POLLEN between them and drive it into the flywheel. - One feeder on two servos:
Indexer.crServo("feeder_left").alsoServoReversed("feeder_right"). Both get the same power. The right one spins the other way, because the two servos face each other. .reversed()on the feeder: on the real robot, both wheels pushed the POLLEN out..reversed()turns both around. (Only one wrong? ChangealsoServoReversedtoalsoServo.) The simulator cannot find this: it turns the wheels the way the code says. Check it on the robot.- They run for a time, not to a position: each shot runs both wheels for up to
feedSec. WithstopOnShot = true, they stop as soon as the flywheel sees the shot (its speed drops). So the next POLLEN does not follow it in. - The ramp: shots leave up a ramp out of the front. The planned ramp is 75 degrees up from the floor. The built one is 53 degrees. Why 75: from the side-wall start spots, the HIVE’s up CELL is only about 40 in away. A 75 degree shot is coming down when it gets there. A 65 degree shot is still going up.
.spinAtStart(): the flywheel is at speed from START, ready to fire. B switches it off.- The Tunables sections:
Launcher, andFeederfor both feed wheels (.tunables("Feeder"): one section for two servos).speedRpm = 3450,stepRpm = 50,readyBandRpm = 100,sprayEnabled = true. Why a ready band of 100: at 3450 the wheel sat near 3429, and with the library’s 60 it seldom fired.kP = 40,kF = 12.5: goBILDA’s tested numbers for this robot.batteryCompensation = falseuntil we prove it on a real robot.Feeder:powerandfeedSecare the library’s (1.0 and 0.4) until the Feed Time Finder measuresfeedSec.stopOnShot = true.
- No shot table, hood or piece sensors. Robot 1 shoots POLLEN only, from known spots, at
speedRpm. So skip “Two kinds of pieces”, “A hood” and “Know which piece fires next”. The D-pad changes the speed bystepRpm. - Its numbers on the robot: the Flywheel Finder at 3450 RPM, then the Feed Time Finder for
feedSec. Step 8 has the steps.
Check:
r1-feed-wheels.sim: both feed wheels: one RB, one POLLEN.r1-no-feeder.sim: with nofeeder_leftandfeeder_rightin the configuration, INIT goes on, the flywheel spins, and RB fires nothing.r1-v1.sim: it fires a POLLEN, and B switches the flywheel off and on.
Try it (optional): in Tunables.java, set Feeder.power to -1. Run r1-feed-wheels.sim. It fails:
no POLLEN fires. Why: below 0, both wheels turn the other way and push the POLLEN back. Then undo it.
The camera
Section titled “The camera”Robot 1’s code:
camera = add(Camera.webcam("Webcam 1").autoExposure().goal("BLUE SCORING", "RED SCORING")); public static class Webcam1 { // "Webcam 1" in the configuration (the Logitech camera) public static boolean liveView = true; // its picture on the Driver Station (menu > Camera Stream, in INIT), PRACTICE only public static double pitchDeg = 35; // tilted 35 degrees up (to see the HIVE): the aim uses the floor's angle. TODO measure the mount }
public static class Aim { // a fixed name: always Aim (the library's defaults for the rest) public static boolean aimOnFire = true; // RB with the HIVE in view: turn to it, then fire public static double aimOnFireSec = 0.5; // the most RB waits for that turn before it fires anyway }Learn it: Add a camera. Read “Robot.java: one line”, “Tunables.java: its numbers” and “Controls.java: its buttons”.
Why robot 1 does it this way:
-
A Logitech webcam on a USB port, called
Webcam 1in the robot configuration. -
autoExposure(): at INIT the camera tries a few brightness settings, and keeps the one that sees the most AprilTags. -
No turret. Robot 1 turns the whole robot to aim. Skip Add a turret.
-
No
.speedFromDistance(camera)and no.requireReady("aimed", ...). Robot 1 has no shot table, and it fires even when it does not see the HIVE. -
pitchDeg = 35is from the plan. Measure the mount with a phone level app. -
aimOnFire = true: with aim mode off, RB with the HIVE in view turns the robot to it, then fires. -
The simulator’s camera: the simulator writes
simulator/robot.propertiesfromRobot.java, but it does not write cameras. Robot 1’s camera line is in that file by hand. It has no# from Robot.javamark, so it stays when the file is written again:simulator/robot.properties camera.Webcam1 = name=Webcam 1, forward=4.5, left=0, up=14, yaw=0, pitch=35, hfov=42.5, width=640, height=480 # Logitech C270 on the top platform, front of the top bracket (Fusion). TODO measure the mount -
Until the camera is on the robot, leave
Webcam 1out of the robot configuration. INIT warns that it is missing, and everything else works. -
Its buttons (aim mode, the lighting test) are in step 5.
Check:
r1-camera-lighting.sim: the lighting test runs at INIT, and its line is on the Driver Station.r1-camera-aim.sim: on the RED side, 10 degrees off the HIVE, the camera sees the RED tags, and aim mode turns the robot to face the HIVE.
Try it (optional): run Simulator, pick R1 TeleOp, and drive robot 1 until the HIVE is in view.
Read the Goal line’s distance. Then set pitchDeg to 0 in Tunables.java, run the simulator again, and
stand on the same spot. The distance is wrong now. Why: the camera works out the distance along the floor
from its tilt. Then undo it.
Parts working together
Section titled “Parts working together”Robot 1’s code:
// Right after START, push the intake over (the library moves nothing in INIT: its safety choice). atStart(() -> deployAtStart ? Actions.deployIntake(this) : Action.named("Intake stays folded (the autonomous deploys it)"));Actions.deployIntake is in step 3.
Learn it: Make parts work together. Read “1. What it is”. The rest of the page is about a lift, an arm and a claw.
Why robot 1 does it this way:
- No safety rule. Robot 1 has no lift, arm or claw, so no part can hit another.
- One action with several parts:
Actions.deployIntake(the deploy servo, then the intake). deployAtStart: the three autos start with the back on a wall. There the intake would fall onto the wall. So each auto setsdeployAtStart = false, and deploys the intake while it drives away..feedWheelOutWith(intake)on the launcher: when the intake pushes out (double tap LB), both feed wheels turn backward too.
Check:
r1-v1.sim: in R1 TeleOp the intake drops at START.r1-auto-right.sim: in the Right Wall autonomous the intake stays folded at START, then drops while the robot drives off the wall.
Try it (optional): in autos/RightCornerLaunchAndPark.java, delete the line
robot.deployAtStart = false;. Run Simulator, pick R1 Right Corner: Launch, Park Right, press INIT,
B (RED) and ▶. Watch the back of the robot: the intake falls onto the wall at START. Then undo it.
Done when: you know each of robot 1’s parts, where its code and numbers are, and which test proves it.
Next: Step 5: The buttons.