Skip to content

Cursor/cone corridor - #34

Closed
jmbrunick wants to merge 4165 commits into
NotAutopilot:nap-releasefrom
jmbrunick:cursor/cone-corridor
Closed

jmbrunick wants to merge 4165 commits into
NotAutopilot:nap-releasefrom
jmbrunick:cursor/cone-corridor

Conversation

@jmbrunick

Copy link
Copy Markdown

No description provided.

cursoragent and others added 30 commits September 19, 2026 02:45
…jects

Default Radar Enabled Off in RadarScenario so distance/velocity/incumbent
association stays stock fusion. Prefer-without-Auto tests opt in.

When the incumbent track disappears and the live table is only
oncoming/off-path, clear the lost-hold cache instead of ghosting the
old lead for 8 frames.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Path-gated radar prefer as default (not rain-Auto)
* nap: Off/Auto wipers UI plus stalk double-flick toggle

Settings only offer Off and Auto (persist 0/3). Legacy Int/On coerce to
Off. A physical WprSw6Posn 0→1→0 flick within 1 s toggles NAP Auto and
shows a brief Wipers Off/Auto HUD, without changing stock stalk rest.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: split wiper stalk tests out of the oversized body-controls file

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Soften empty-table / erratic reliability so brief gravel crawl blips do not flash Radar Unreliable. Hard canError / radarFault / unavailable still fall back and alert. Publish radarPreferReason.
* Don't HUD-flash Radar Unreliable on pavement clutter

Dropout / erratic (signs, opposing, empty-table) still drop prefer
silently. Timeout HUD needs a sustained engaged confirm and is muted
when a healthy path-associated lead exists. canError / radarFault stay
immediate.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* Never HUD on radar timeout either — only real faults

09:45–10:05 CT dig: 41 blips, all empty-table/timeout, 0 radarErrors,
0/41 with a lead. #209 still flashed because timeout was a hard HUD
reason. Soft empty / timeout / erratic stay silent camera fallback.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
First-latch acquire slews both ways so MPC cannot punch regen then rematch +a. Large-slack small MPC bites stay at the mild floor. Near-gap match-speed, rapid close, near-bumper, and FCW keep full -a.

Tesla Pre-AP longitudinal regressions green. Admin-merge over known non-Pre-AP flakes (static analysis / process replay).
Comfort path stays at MILD -0.22 on non-emergency approach. Full -a is rapid / near-bumper / FCW only. Tesla Pre-AP green. Admin-merge over known non-Pre-AP flakes.
MAX is a hard ceiling. If the lead is faster than set, hold at MAX and let the gap open. Remaining-close / rematch no longer command Accel-1 past MAX. At/above MAX, lead-close a_env is 0 not Accel peak. Catch-up under MAX, #214 acquire slew, #216 slight-lift floor, and emergency -a kept.

Merged after Tesla Pre-AP green.
* nap: glide at matched speed and settle earlier inside follow distance

Keep #214 first-latch acquire slew. When speeds match near the gap, deadband
aTarget to coast / slight EV lift so rematch trickle cannot fight the mild
floor. Aim a few meters long while still closing, and use progressive gentle
-a for a slow close already inside Follow Distance. Rapid / bumper / FCW stay
full authority.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: do not delay first mild-ease onset on near-gap slew

Near-gap small-bite slew is only for floor↔release chatter. Starting from
0 must stay immediate so earlier settle is not postponed a half-second.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: glide only at/long of follow distance, not inside

Too-close recovery needs rematch +a and mild -a. Glide on slack<=10
including deep-negative zeroed that path and left FD1-7 short.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: tighten glide to last meters so Follow 1 can finish

A 10 m / 0.5 m/s deadband coasted through FD1 (22.91 vs 23.5) and
cut rematch the grade hold needs. Enter only when truly matched in
the finish band; rematch trickle still stands.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: glide on slight sag so leftover mild does not chew grade

Follow 1 finished. Grade hold was still 0.12 m/s slow because a
-0.3 sag left the -0.22 floor on. Matched-or-slower at the gap
zeros that bite; rematch trickle and Accel sag still stand.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: glide slack covers grade-hold band, still not while closing

Plant-aligned grade dips ~5-10 m long of FD. A 4 m finish window
missed that leftover -0.22. Restore 10/14 m slack; keep closing
off so Follow 1 cannot coast through.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: do not slew rematch +a through the near-gap chatter path

Plant-aligned grade hold sat at 24.365 on three glide tunings.
-0.22 to +0.08 was walking 0.02/frame. Regen-side chatter still slews.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: skip glide on a braking lead; allow slight close only with room

Near-gap aLead -0.4 was snapped to 0. Last-meter closing still
keeps -a (Follow 1). Slight close at 5-10 m may glide so grade
does not sit on leftover mild.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: retrigger Tesla Pre-AP on glide tip

Previous tests run stayed on a21ddda through card replay, so
8615a26 never got a Pre-AP job.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

* nap: inside-FD rematch check is under MAX after #219

#219 zeros rematch +a at MAX. The recovery unit test was at set
speed so +0.08 became 0. Give it 6 m/s of MAX headroom.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
#216 kept the EV MILD -0.22 floor until confirmed rapid >= 6, near-bumper,
or FCW. A lead hard-brake that closed 1.8->4.4 m/s (dRel 38->25) never
escaped slight-lift. Restore the #187/#188 soft-limit skip when closing
>= 1.5 or a near-gap braking lead (slack <= 20 m). Matched / slow-close
and large-slack e4 stay MILD / #218 glide. Firm 0.55 / full hard-brake
still wait on the rapid confirm. Rapid gate stays 6.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Use the log vRel (4.44 m/s) instead of mph-delta so the gate test
matches the episode that stayed under RAPID 6.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Product intent: on a held / path-synced lead, rising close (and
aLead) is the brake signal. Soft-limit skip already used that gate;
document it so it is not read as rapid/bumper-only.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Primary brake signal is an already-owned / path-synced lead whose
closing starts climbing (residual close beyond ego a, or aLead).
That releases the MILD -0.22 floor without waiting for rapid 6 /
near-bumper. Cut-ins may still skip once closing >= 1.5. Firm /
full hard-brake stays on the rapid confirm so a radar blip cannot
dump. Matched follow and large-slack e4 stay MILD / glide.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Closing that worsens beyond ego a is inferred lead brake. Skip the
MILD floor and match measured/inferred aLead so 07:55 cannot sit at
-0.22. k*v_rel extra / full hard-brake still waits on the rapid
confirm so a radar blip cannot dump.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Closing that worsens beyond ego a now releases the MILD floor and
matches inferred aLead on a held lead even when the single-frame
Δv is under the 0.15 rise gate (07:55 class). Map decel above MAX
still mins in on a same-speed lead. Firm dump stays confirm-gated.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
lead_at_or_above_max includes sitting at cruise, so the map-decel
bypass skipped e4 acquire slew when vCruise == vEgo (first latch
−0.22 instead of −0.05). Gate that path on ego faster than MAX by
the map deadband. Residual skip / match-aLead unchanged. codespell
canceling in RELEASES.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
The docs wire test took the first "Hill Climb" paragraph, which is now
the #192 keep-line, not the maps-elevation "NOT included" notes.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
nap: skip mild floor on closing / near-gap braking lead
Detect OSM junction=roundabout (or a compact closed circulating way)
80-100 m out — not a big steer and not a sharp town corner. Soft comfort
decel toward 15-20 mph (OSM ring maxspeed when present). While circulating,
~0.45 m outer in-lane bias (right in RHT / US).

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Planner ease goes through apply_roundabout_plan so the Willmar +0.4
aTarget case is unit-tested without a cereal/scons loop.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Willmar 10:11/10:13/10:14: detect at 86–95 m was fine, but aTarget
was only −0.55 (Lookahead comfort) and outer bias 0.45 m lost to a
3.3 m inside cut. Plan 15–20 from ~200 m with kinematic a ≤ −1.0
from 40–45 mph, clamp +a in the funnel, latch full ease on long
enable, and hold a 3.2 m outer path offset on entry + circulating.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Comfort-only follow-smooth for Justin's 10:18 CT acquire/close: trickle Accel rematch while slowly closing, slew small post-acquire ±a, and do not dump plant regen when planner aTarget is ~0. Rapid / residual-close / FCW stay full authority.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Point opendbc at the Pre-AP plant guard so aTarget≈0 cannot dump REGEN_MAX (10:18:42). Planner ≤ -0.5 still has full regen.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
…bias-f38b

nap: parked WIP — roundabout detect / ease / outer bias
Soft-cap rematch only in the 12–50 m / 0.8–2.0 m/s band so large-gap
recovery still uses Accel. Import pytest in the LongControl regen test.
Point opendbc at the plant floor that leaves grade/pitch authority.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Same-speed / opening slack > 12 latches Accel so follow-distance
recovery can finish FD. Already closing 0.8–2.0 in-band (ef 10:18)
stays trickle. LongControl regen test matches passthrough a_target≈0.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Do not drop the mid-gap catch-up latch just because v_rel exceeded
2 m/s, and arm it when slack crosses 12 m from inside FD so Follow
recovery can rematch.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
Inside FD now latches catch-up so settle cannot freeze rematch while
the gap is wrong. Chatter slew is immediate on that path. 10:18
in-band slow-close without the latch still soft-caps.

Co-authored-by: jmbrunick <jmbrunick@users.noreply.github.com>
jmbrunick and others added 20 commits October 13, 2026 11:31
speedsign HUD: touch only inside visible Yes/No, guarded render, tap I/O off UI thread
…e 2 Hz publish loop

Oct 13 11:25 CT (route 0000018e seg 23): deviceState went silent 13 s while
get_som_power_draw() blocked 12.6 s in sysfs -> commIssue -> disengage.
Power draw, SOM power, GPU, CPU, memory, free space, screen brightness and
booted() now run in a background reader thread with per-read timing
('hardwared slow sysfs read' cloudlog event; no capnp change). The publish
loop uses cached values only. Adds a test simulating a 13 s hung power-draw
read; deviceState keeps publishing at 2 Hz.
hardwared: power-draw + remaining sysfs reads off the publish loop (11:25 commIssue)
…20 ft cap, crossing handoff)

- Only animal/human chime; obstacle/unknown are log only (chimeReason log_only_class)
- Human: camera-evaluated human score >= 0.40 and within 0.9 m (3 ft) of the path edge; radar-only human never chimes
- lively: sustained ground motion (|along| or |vLat| > 0.4 m/s for 0.5 s); drop range wander that read 1.0 on still posts
- Still animal needs camera animal >= 0.75; dark scene (lighting < 0.5) + single point never an animal chime
- Still single in-path point at 40-60 m needs a 2nd member or solid camera hit (road surface)
- Hard 20 ft cap from path centre; no chime when a vehicle-sized crosser belongs to crossing-vehicle handling
- 15 mph gate unchanged; tests from the nine Oct 13 events
No new log fields or subscribers.
Object chimes: animal/human only, fixed lively check, 20 ft cap (Oct 13)
… 1.0 m (Oct 13)

Hold my line (cone_line_hold.py, steering):
- capture the driver's actual lane offset (modelV2 lane lines) when he pushes, re-capture on every push (wheel torque only, never the stalk)
- hold it with no fade while the cone line is active, plus 3 s, then release over 2.5 s
- a push back to near centre lets go; never commands closer to the cones than the model path
Cone shift (cone_line.py -> controlsd via coneLineNAP.wouldSteer, NAPConeLineHold toggle):
- line 1.2-2.6 m from path centre at >= 20 mph: shift away up to 1.0 m (aim line at 3.2 m), inside the lane, ramp 0.2 m/s
- never for lines inside 1.2 m, below 20 mph, with a lead in the cone span, or under an overpass/gantry
Camera confirm (cone_cam.py, still log only):
- MAX_SAMPLES 12000 -> 3000 so all 6 windows fit the budget; budget-split frames can confirm together
- a 0-hit frame clears confirmed (stale-confirm bug x3); reject red tail lights and in-footprint (vehicle/queue) lines
Schema comment: coneLineOffset is +right (comment only, no new fields).
Tests from passes A-G and pass E's 80 s hold.
Cones + Hold my line: hold his real offset, in-lane cone shift up to 1 m (Oct 13, steering)
- curve preview: slowing 2.5-3 s before turn-in, 1.5 s lag comp, cap -0.8, done by apex
- roundabout: brake cap -1.0, final slowdown ~40 m earlier
- RingExitGate: restore only on right blinker + curvature unwinding on the ring, 1.75 mph/s;
  release once off the ring; ring latch suppresses ALC from the blinker
- map limits: liveMapDataNAP.source osm_default for untagged state defaults,
  drops to defaults <= 0.5 m/s2, rural tertiary/secondary keep 55 on the same road,
  cloudlog tagged vs default
Curves, roundabouts and map limits (Oct 13)
Settings sidebar: Bookmark button (log bookmark + voice note)
Web dashboard: Bookmark tab button (bookmark + voice note)
…v2 fallback

- weights_manifest: RELEASE_TAG speed-sign-onnx-v3, sha 45e8d44..., 12658971 bytes; same 13-class order and [1,17,2100] output.
- install: fall back to the v2 asset if the v3 download fails (default source only); weights_loadable() accepts v3 or v2 so an installed v2 keeps working until Install weights is tapped (status shows Out of date).
- proposer-v1 unchanged; YOLO_MIN_CONF stays 0.40.
- tests updated + fallback tests.

@github-actions github-actions Bot 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.

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

speedsignd: ship speed-sign-onnx-v3 reader (v2 fallback)
…e-out release

Oct 14 route 194 seg 25 (Ridgewood Rd 08:28:47-08:29:14 CT): only the right
barrels were tracked; wouldSteer shifted left (max 0.25 m) toward the
untracked centreline cones.

- ConeCorridorDetector runs a left-only and a right-only ConeLineDetector
- both sides: shift to the corridor midpoint; one side: firm offset away (cap 1.0 m)
- hard rule: never shift to within 1.5 m of a tracked line; a line already
  inside it pushes the path away at 1.0 m/s (normal ramp 0.5 m/s, 15 mph min)
- after the corridor drops (detector ~2 s hold) wouldSteer eases to 0 over
  3 s (smoothstep) and the hold keeps applying it while releasing (no snap)
- low-visibility fade does not apply inside a cone zone
- coneLineNAP fields @12-@18 claimed: leftActive/leftClear/rightActive/
  rightClear/corridor/marginM/releasing
- Hold my line arming unchanged (wheel torque only); no new subscribers
@jmbrunick
jmbrunick force-pushed the cursor/cone-corridor branch from fbffec1 to 09b29c7 Compare October 14, 2026 14:16
@SloPOS

SloPOS commented Oct 14, 2026

Copy link
Copy Markdown

4100 commits without documentation? Was this PR made by mistake?

@jmbrunick

jmbrunick commented Oct 14, 2026 via email

Copy link
Copy Markdown
Author

@jmbrunick jmbrunick closed this Oct 14, 2026
@SloPOS

SloPOS commented Oct 14, 2026

Copy link
Copy Markdown

No worries, just wanted to be sure before I started dissecting it haha. Looked like some interesting features you got there ;)

@jmbrunick

jmbrunick commented Oct 14, 2026 via email

Copy link
Copy Markdown
Author

@jmbrunick
jmbrunick deleted the cursor/cone-corridor branch October 14, 2026 22:14
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.

3 participants