End your launch with these three things in a straight line:
Your kick sends the ball the way the bot is facing, so finish the launch behind the ball, pointed straight at the goal — and stop a little short of the ball so the sonar can see it and the code can aim the kick.
Field is 8 ft × 4 ft, so (4,2) is dead center — where the ball sits.
| Leg | From → To | Move | Distance |
|---|---|---|---|
| 1 | (0,4) → (0,2) centerline |
turn LEFT 90°, drive forward | 2 ft ≈ 61 cm |
| 2 | (0,2) → toward (4,2) center field |
turn RIGHT 90°, drive forward | stop ~40 cm behind the ball |
You do not drive all the way to the ball. Stop ~40 cm short — that's the sonar's detect range. The locked code then rolls in the last bit and takes the shot.
// Leg 1: turn LEFT toward the centerline, then drive ~2 ft. CutebotPro.trolleySteering(CutebotProTurn.LeftInPlace, 90) basic.pause(150) CutebotPro.runBlockCnt(2) // 2 blocks × 27 cm = 54 cm basic.pause(150) // Leg 2: turn RIGHT to face the goal, then drive to ~40 cm behind the ball. CutebotPro.trolleySteering(CutebotProTurn.RightInPlace, 90) basic.pause(150) CutebotPro.runBlockCnt(3) // 3 blocks × 27 cm = 81 cm basic.pause(150)
runBlockCnt(n) drives exactly n × 27 cm — the same real distance on every bot, fast or slow. That's why we use it for the launch.
Turn direction — check this FIRST.
Left vs. right depends on your start corner and which way the bot faces. This default is built for corner (0,4). Run it and watch Leg 1: if the bot drives into a wall instead of toward the middle, your first turn is backwards — swapLeftInPlace ↔ RightInPlace (flip the other turn too, so they stay opposite).
Distances — convert your own measurements. 1 block = 27 cm.
| Distance | ≈ cm | ≈ blocks |
|---|---|---|
| 1 ft | 30.5 cm | 1.1 |
| 2 ft | 61 cm | 2.25 |
| 3 ft | 91 cm | 3.4 |
| 4 ft | 122 cm | 4.5 |
Stop short of the ball on purpose.
- Bot stops and just roams instead of kicking → Leg 2 is too short, add a block.
- Bot shoves the ball sideways before aiming → Leg 2 is too long, drop a block.
The two turns must match.
Both are 90° so you end square to the goal. If your bot consistently finishes angled (wheel slip on turns), tune both turn numbers together — try 88° or 92° until it lines up.Leave the border sensor paused during the move.
Don't turn border detection on mid-launch. You start Leg 2 while still on the back-line tape, and switching it on there makes the bot think it hit the edge — it backs up and spins instead of launching. (This is the "stuck on the black line" bug.) The locked code turns border safety back on after you reach open field.Change one number at a time.
Adjust a single block count or turn angle, run it, watch where it stops, repeat. Changing two things at once makes it impossible to tell what helped.Batteries and floors drift.
A fresh battery drives a hair farther per block than a low one, and slick vs. grippy floors change your turns. Re-check your launch after a battery swap or on a new field.| What you see | Likely cause | Fix |
|---|---|---|
| Drives into a wall on Leg 1 | Turn direction backwards | Swap Left ↔ Right on both turns |
| Ends up angled, not facing goal | Turns over/under-rotating | Tune both angles (88°–92°) |
| Stops and roams, never kicks | Leg 2 too short (ball out of sonar range) | Add a block to Leg 2 |
| Knocks the ball off-line | Leg 2 too long (rammed the ball) | Remove a block from Leg 2 |
| Backs up and spins right after the move | Border turned on while on tape | Keep launchActive = true through the whole move |