Skip to content

Regionals final: corner auto, Scoring Auto, tuned volleys (winning alliance + Inspire Award) - #15

Merged
AndreNijman merged 29 commits into
mainfrom
feature/sotm-sim
Nov 15, 2026
Merged

AndreNijman merged 29 commits into
mainfrom
feature/sotm-sim

Conversation

@AndreNijman

Copy link
Copy Markdown
Contributor

The robot code as it ran at regionals on 15 Nov 2026, where team 29550 was on the winning alliance and won the Inspire Award. It is the code deployed on the robot for the final matches. 29 commits since the last merge (#14); 561 unit tests pass.

Autonomous

  • Lebot Auto Red/Blue (Scoring Auto), brought over from feature/auto: preloads, Garden and Flower cycles, volleys from Volley Tuning's confirmed spots, park 10 cm off our wall in the loading zone. Driven with Pedro Pathing on Foresight constants measured from 13 Nov's Pinpoint logs.
  • Lebot Corner Red/Blue (Corner Auto), built at the event to fit around a partner on the Garden side: preloads into SCORING from spot 5, wait in the rear corner, take our wall's Flower, volley into AUDIENCE from spot 5, then park at the loading zone's Garden end, turned to SCORING, and shoot what's left.
  • Autos feed the next ball of a volley only once the wheels are back up to speed: with the last roller loading, the 4th preload left 0.17-0.20 s after the 3rd and missed.
  • Intake and indexer run whenever the auto loads or shoots; the indexer pulses (load then pause or reverse) through the Garden and Flower so the stack indexes up. The intake stops rather than ejects when full.
  • Odometry keeps the pose through a late Pinpoint reset, and the auto holds still until it lands. INIT moves nothing.
  • Shoot Auto parks in loading zone A5.

Shooting

  • TeleOp and the Scoring Auto shoot with Volley Tuning's confirmed per-spot settings (/sdcard/FIRST/VolleyTuning_v3.csv), including backward spots.
  • Volley Tuning: a spot is confirmed after two good volleys, LB marks all IN, and only the spots that matter are tuned.
  • Faster volleys with every ball counted; one-ball feed gate with lead, minimum feed spacing and a retry pulse.
  • Shot table and backward table refit to 7 Nov calibration; moving shots allowed, far backward shots shortened; the backward shot in front of the Cell is forced only within 0.95 m of the lip.
  • Aims at our Cell in front of the robot, not the one the tags vote up.
  • SOTM Tuning calibration tool and TeleOp moving-shot corrections; 7 Nov calibration CSVs under the data folder.
  • Hood fast loop restarts itself after a main-loop stall.

TeleOp and mechanisms

  • TeleOp starts from the auto's pose; short driver view and driver hints on the Driver Station; STOP reminder in the autos' telemetry.
  • Intake: runs only on LT, wheel-contact full detection, ejects extras when full, rumble when it trips; amps and overload on their own telemetry line. Packed-stack easing is in but turned off (StackPressure.ON = false).
  • Pollen ramp on its servo, stowed about 8 degrees further back (1490 us).

Vision

  • Comp venue camera settings (exposure 2 ms, gain 15); exposure, gain and frame brightness logged.
  • Frames skipped while a camera stream restarts; camera rebuild on failure.

Competition settings

  • Panels and live logging are off (Main.PANELS_ENABLED = false, Main.LIVE_LOGGING = false); hub ports 5810/8001 closed.

Not yet checked on the field

  • The Corner Auto's park shooting and the auto's wait-for-speed between balls were deployed after the last logged runs.
  • The Corner Auto's second volley mostly shot 0-1 balls in the logged runs: the Flower's balls weren't reaching the shooter. Unresolved.

…d spots

Shot Tuning:
- Carries on the CSV's last session at its spot: counters, trims, finished
  searches and the current search replayed from its marks (Y in INIT starts
  a new one).
- No manual shot changes: only the search sets the hood or RPM.
- B drives to the next spot not yet done for this shot (backward: G0-G5).
- A changed mark replays the search with it.
- Backward search: a higher launch angle is flatter and comes in under the
  rim, so short now steepens it; misses past the scoring values bound that
  edge whatever they were called; lower limit 88 deg.
- Backward spot changes turn the rear cameras to the Hive, wait for tag
  fixes, drive, check the spot on the tags, then turn around to shoot.
- Turns in steps to find the tags while the pose or Cell isn't known.

Robot: spot hold rests within 4 cm and returns to 1.5 cm with rising power,
instead of stalling the drive motors; scripted turn for the locked sticks.
…tion

The hooded table is regenerated from the model refitted to Shot Tuning's 224
hooded balls (exit speed 0.001576 m/s per RPM, launch offset 9.5 deg, hood
from 55 deg, distances from 0.3 m), so the -75 RPM hooded offset is dropped.
The backward table takes each spot's RPM search from Shot Tuning 085918:
0.63, 0.73 and 0.81 m points between 0.40 and 0.95 m.
…ctions

- SotmTuning OpMode with SotmPath plans, per-spot hood and aim searches
  (SotmSpotSearch), CSV replay and carry-on between sessions
- ShotSearch: limit off the quantum counts as the edge; confirm reopens the
  search when most confirming balls miss on range, dropping contradicted ins
- AimTrimSearch: step grows on the 3rd same-side miss in a row; replayed balls
  move on from the trim they were fired with
- FieldRoute: stuck boost lifts the reload stick cap; slow zone near reload
- Steady gate uses the plan's stick size during scripted runs
- TeleOp: standing aim trims (hooded +2.0, backward +1.5 deg) and a moving
  hood trim by lip distance (-2.3 deg at 0.95 m to +0.7 deg at 1.48 m),
  fitted to the 17 spots found 7 Nov
- Backward shot search, shooter spin modes, heading lock twist and tests
…on, volley tuning

- Shoot Auto: seeds the pose in the start corner so it aims before the
  cameras see a tag, steps its search turn, and drives a lane route that
  keeps clear of the Hive and the wall Flower to tile A5 (the manual's
  loading zone), with a minimum power so it no longer stalls short
- WheelContact detects a full stack from the shooter wheels' RPM dip
  when a ball touches them while loading; beam breaks are no longer used
- Shooter holds its pre-spin speed for 1.5 s after a shot goes invalid
  instead of braking to idle on every NO_SAFE_SHOT flicker
- Alliance warning when the cameras see the other alliance's Hive
- Intake only on LT, instant intake reset, overload guard, indexer retry,
  loading/shooter interlock, motor reversal guard
- Backward volley bursts, Volley Tuning / Volley Spot Drive OpModes and
  the auto tuner, shot table RPM lookup, power telemetry
…pted drives

- Pedro Pathing (revhub 3.0.2, tuning 1.0.3) and the pedro package from
  feature/auto's WIP: Foresight constants (guesses until the Foresight
  Tuner runs), the Robot-pose localizer, captured and direct drivetrains,
  and the tuning menu
- Shoot Auto parks by Pedro: one Bezier curve through the lane's corners
  (each doubled, so it rounds them tightly, clear of the Hive and the
  Flower) at constant heading, followed from the tag-corrected pose
- The Robot squares a scripted stick as it does the driver's, so half
  power came out as about a quarter and the park's braking was mostly
  lost; stickFor inverts the curve for Pedro and the fallback park
- The fallback park (PARK_WITH_PEDRO off) plans its speed to stop at
  each corner and at the zone instead of driving full stick into it
- Parked only when within 6 cm and under 0.15 m/s, so the wall push no
  longer carries leftover sideways speed over the zone's edge
- Tests: Pedro and fallback parks on a robot modelled on 13 Nov 220620
Top speeds, decelerations and braking come from the robot's own driving
in 42 of today's runs, as the Foresight Tuner would measure them: full
power for the top speeds, the auto's no-power stops (drive on BRAKE, as
Shoot Auto runs it) for deceleration and the braking fit. The guesses
were float mode's: 31 in to stop from 60 in/s against the 10 measured.

Linear braking carries 0.07 s of control delay on top: without it the
park ran 6.6 cm past in the test's model, with it none, in 3.0 s. The
model now slows down with the 0.16 s a no-power stop takes on BRAKE.

The translational kPs are still guesses.
Brings in the 6 Nov Pedro Pathing scoring auto (AutoField, AutoSequence,
ScoringAuto, TipPredictor) and the Robot hooks it drives: autonomous mode
with no gamepad, auto shoot/intake, an AutoDriver for direct drive powers,
and startAt for the known start pose. The drive runs on BRAKE to match the
Pedro constants measured on 13 Nov.
The auto's blank gamepad kept LT at 0, so with INTAKE_ONLY_ON_LT the intake stayed off and the indexer on STOP even with autoIntake set.
…the auto still until it lands

13 Nov 223434: the reset INIT asks for finished 0.17 s after START, and the
start pose had been set against the Pinpoint's old reading from the run
before. When the reset landed the pose jumped 0.45 m and 32 degrees, and the
Scoring Auto drove over the field edge in the red/audience corner.

A good read back at zero after bad reads, jumped from the read before them,
is now taken as a reset and the offset redone so the field pose carries on.
The Scoring Auto stands still, without the aim's turn, until the Pinpoint
first reads good.
13 Nov 224556: autoShoot reached the aim but not shotRequested, which read the blank gamepad's RT, so the indexer stayed on STOP and the auto shot nothing in 29 s. autoShoot now stands for RT held down everywhere RT is read.
- ACCEL_WINDOW_S 0.1 -> 0.2: over one loop the Pinpoint's speed noise alone read
  past 1 m/s^2 (12% of loops at a steady 0.6+ m/s), so the steady gate held 40-46%
  of RT time at 0.6-1.2 m/s. Over 0.2 s, 2%.
- BACKWARD_RPM past 0.81 m cut 5-10%: Lebot Teleop's far backward volley balls
  (1.5-1.9 m) went long at 3505-3812 rpm; each point now sits 90 rpm (half the
  opening) under the slowest long ball near it. The calibrated 0.40-0.81 m points
  are unchanged.
…out, and rumble when the intake trips

Loading on into a packed stack, the intake (4.4-5.8 A) forced the first ball past
the backward-held feeder into the spinning flywheels (13 Nov 225900 at 73.5 s).
StackPressure sees 4.2 A held 0.4 s while loading; the intake then drops to half
power and the last roller stops (LOAD -> STAGE) until LT is pressed again, B
ejects or a ball leaves. Not in the auto.

A tripped intake overload now rumbles 1 s, then 0.4 s every 2 s until LB resets it.
…ags vote up

13 Nov's far backward volleys went to our Cell on the far side of the Hive, past and
right of the near one the driver meant: the tip vote flipped 2-7 times a run. TeleOp
now aims at our Cell on the robot's side (x > 0 AUDIENCE, x < 0 SCORING), changing
sides 0.15 m past the middle and never mid-shot. Picking the right one is the
driver's call. AIM_AT_FRONT_CELL false brings back the voted up Cell; the Scoring
Auto keeps its own aim point.
TeleOp showed ~30 lines of every subsystem's state. It now shows the shot (Cell,
distance, hooded or backward), the aim (ready, or what it is lining up on), one
power line, and only the problems to act on: pose not placed, flywheel stall, hood
encoder fault. TELEMETRY_DETAIL in Panels brings the full view back; the tuning
OpModes always have it.
…p a packed stack eased

- Volley: the next ball feeds once the wheels are back within VOLLEY_LEAD_BELOW_RPM (150) of target
  and rising, with everything else ready, so its travel overlaps their recovery. The 0.20 s floor
  that made VOLLEY_MIN_GAP_S dead is gone. 13 Nov replay: 0.18 s saved a ball.
- A volley ball counts at a 170 RPM fall from the peak (was 200): 52 of 276 were missed.
- "Packed" and "full" clear on an LT press only after LT was let go REARM_RELEASE_S (0.5 s):
  tapping re-armed the full push every press.
- WheelContact ignores wheels coming down from over the target and a target that moved in the
  last 0.75 s: the Scoring Auto ejected at the rear Flower for 3.2 s on that (224556).
- In the auto a full stack stops the intake instead of ejecting, and ends the Flower step.
…er hints, camera rebuild

- PoseHandoff: both autos leave their last known pose and alliance on stop. Lebot Teleop takes the
  alliance in INIT and starts from the pose if under 60 s old (A still resets the heading).
  13 Nov: TeleOp started 140 degrees off after the Scoring Auto, for 4.7 s.
- ShootAuto: DRIVE_MAX_STEP_M 0.12 -> 0.4 (real steps were dropped, it drove up to 1.48 m for 0.6),
  power cut early by v^2/(2*2.0), and SETTLE holds the planned spot. It turns to the Hive at once;
  only the feed waits for the tags or VISION_WAIT_S.
- One tag can place a robot whose heading was seeded by placement: 5 Shoot Autos got no fix in 30 s.
- Driver view says what stops a moving shot ("STOP: too close to shoot moving", "slow down
  sideways") and rumbles once after 0.4 s.
- HEADING_KS_BOOST_MAX 0.15 -> 0.25: the lock sat 5.2 degrees off a 4 degree tolerance for 2 s.
- Cameras get a worker each; a call hung over 5 s closes and reopens that camera (5/10/20 s
  backoff, at most 3), and "CAM R DEAD" shows on the driver view. 13 Nov 165003 lost R for 109 s.
- INIT warns and rumbles to swap a battery under 12.3 V at rest.
…IT moves nothing, TeleOp bounce and intake fixes

- Auto shoots from Volley Tuning spot 4 exactly as tuned (8/8, 14 Nov 224053) and curves to the Garden below the Hive
- Volley Tuning starts at, and drives to, the real auto park spot against our wall
- Nothing moves in INIT (G403): hood homes and ramp powers at START
- Pollen ramp servo (Expansion Hub servo 1), D-pad up toggle
- Volleys run the indexer at full power and feed at most every 0.30 s, as tuned
- Backward-only wedge pointed the wrong way: TeleOp shot hooded from in front of the Cell and bounced out
- Packed-stack intake ease no longer latches at half power: it clears once the intake runs free or on an LT
  re-press; the last roller stays stopped until a ball leaves
- TunedVolleyLockTest pins the tuned volley settings and spots
… IN, tune only the spots that matter

- A setting is confirmed by two good volleys in a row (3+ IN), at the middle of the trims that scored, instead
  of searching all ten settings first (20+ volleys a spot)
- LB marks every unmarked ball IN at once
- Spots visited: PARK, 4, then side spots 5-9; spots 0-3 sit in the backward-only wedge where TeleOp now shoots
  backward (spot 0 went 86 of 260 hooded)
- Replaying the 14 Nov CSV confirms spot 4 at profile 0, trims -0.5/-0.5, as TeleOp already used
…95 m of the lip

With the wedge fixed it forced backward shots at any range, but the backward table was only ever shot to about
0.85 m. 61 of 427 TeleOp balls (7-14 Nov) left from 0.9-1.1 m in front, against the rear wall; past 0.95 m they
stay hooded as before.
… stall

The hood fast loop cuts power and ends its thread when the main loop misses
heartbeats for 0.5 s, but HoodSubsystem kept treating it as running and never
activated it again, so the hood froze until the OpMode ended. Volley Tuning
stalled 0.59 s on Circle (15 Nov, 074849): the hood stayed at 56.7 of 74.2
degrees, the hood gate never passed and no ball fed.
…xposure 3 ms / gain 30

A just-restarted stream (under 5 fps) handed over a frame taken before a
36 degree turn, which put the TeleOp Cell 0.7 m off so every ball fell
short (15 Nov 080649). Cell sightings and tag observations now need 5 fps.

At the venue, 5 ms / gain 60 washed the tags out (camera R frames mean
181/255, 22% clipped, margins about half of home). New COMP preset,
selected, at 3 ms / gain 30.
…rmed spots

Volley Tuning confirmed spots 4-10 at full feed on 14-15 Nov (80-90% in),
but VOLLEY_USE_TUNING_CSV was off, so every volley used trims 0 / 0.

- VOLLEY_USE_TUNING_CSV on; only confirmed spots count (spot 0's estimate
  is 12 Nov's 0.6 feeder)
- the park spot is loaded (the list was sized by the grid alone)
- away from every tuned spot, the confirmed spot nearest the robot's
  distance to the Cell (was the best spot's, whatever its distance)
- ScoringAuto loads them at INIT and applies the spot it shoots from
  before each volley: spot 4 at each Cell, the park against our wall
- constant trims (no CSV) -0.5 / -1.0, the confirmed spots' medians
PARK must not touch the wall. The park spot now leaves the turned robot's nearest corner 0.10 m off our wall, centre still in the loading zone, and PARKED no longer pushes toward the wall; Pedro holds the spot.
…osure 2 ms / gain 15

Each camera now logs the exposure and gain it reported back, the lighting
preset, frames delivered, and frame brightness 5 times a second (mean grey,
% clipped white, % crushed black; FrameBrightness), so a match log is
enough to set the exposure. tools/vision/exposure_report.py reads it, with
pull_and_report.sh to fetch the newest log from the hub.

At 3 ms / gain 30 the 15 Nov 10:05-10:11 runs were washed out: camera L
averaged 241-250 with 84-93% clipped and its near margins fell to 62. At
2 ms / gain 15 the 10:14 auto had L at 45% clipped with near margins 134
and R at 17% clipped with margins ~90.
Corner auto (Lebot Corner Red/Blue), to fit around a partner's auto: from
the rear corner it shoots the preloads into SCORING, backs into the corner
and waits 5 s, drives along our wall 10 cm off it to our wall's Flower,
shoots it into AUDIENCE from the spot in front of that Cell, and parks at
the loading zone's Garden end, 10 cm off our wall. The indexer jiggles
(short reverse pulses) from the Flower to the second volley.

Also from 15 Nov:
- vision: COMP_GAIN 20, exposure/gain overrides, Vision Calibration sweep
- volley: EXTRA spots 11/12 and backward spots B1-B4, backward trims and
  RPM per trim degree, a spot counts as solid after 4 good volleys
- volley tuning: circle twice within 2 s skips pending marks as unseen
- intake: stack-pressure easing off (false trips at 4.2 A during pickup)
- scoring auto: indexer agitation at the Garden and Flowers; telemetry
  reminder to select Lebot Teleop by hand after an early stop
Final code as run at regionals on 15 Nov, where the team was on the
winning alliance and won the Inspire Award.

- Corner auto shoots both volleys from Volley Tuning's spot 5 in front
  of each Cell (SCORING, then AUDIENCE).
- Corner auto parks turned back to SCORING, corner 10 cm off our wall,
  and shoots whatever is left.
- Autos feed the next ball of a volley only once the wheels are back up
  to speed (AUTO_VOLLEY_LEAD_BELOW_RPM = 0): with the last roller
  loading, the 4th preload left 0.17-0.20 s after the 3rd and missed.
- Live logging off for competition (Main.LIVE_LOGGING = false).
Copilot AI balanced review requested due to automatic review settings November 15, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@AndreNijman
AndreNijman merged commit 28246ea into main Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants