Ported from StarPilot (mawei/StarPilot): the sunnypilot Honda radar interface
deliberately returns no points for Bosch cars, so radard never sees the stock
radar. This brings in the hand-written 16-slot Bosch-A decoder:
- radar_interface.py: full Bosch-A object bank decode (0x280-0x2FF main frames
plus the 0x290-0x297 companion frames), range/rate/angle conversion and sweep
triggering. Receive only - it never sends CAN, so factory AEB/CMBS/FCW stay
live and no safety change or rebuild is required.
- dbc/honda_bosch_a_radar.dbc: the bit geometry the decoder parses.
- values.py: HONDA_CIVIC_BOSCH and HONDA_CRV_5G (the verified platforms) point
Bus.radar at the new DBC; HONDA_BOSCH_A / HONDA_BOSCH_A_RADAR_VERIFIED sets
describe which platforms may use it.
- interface.py: radarUnavailable is cleared for verified platforms unless a
kill switch is present. The switch is a sentinel file
(/data/params/d/HondaBoschARadarOff) instead of a params_keys.h entry, so no
libparams rebuild is needed.
With radar points flowing, the existing sunnypilot longitudinal control can use
them; nothing in carcontroller or safety was touched.
* modeld: set the valid flag on modelDataV2SP
modelDataV2SP was published with new_message's default valid=False, so
the message was permanently invalid. Nothing acts on that today because
selfdrived lists it under ignore_valid, but it shows up as invalid in
every commIssue dump and hides any real problem behind a false one.
Copy modelV2's flag, the same way fill_model_msg already does for
drivingModelData.
Assisted-by: Claude
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* modeld_v2: set the valid flag on modelDataV2SP
The sunnypilot model runner publishes the same message and had the same
gap. Copy modelV2's flag here too, so both daemons agree.
Assisted-by: Claude
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com>
models: don't block the ui on an unset LagdToggleDelay
Params.get's second positional is `block`, not a fallback value, so
get("LagdToggleDelay", "0.2") passes block=True and does a blocking read.
When the param is unset this spins the ui thread until it appears, freezing
the models panel (the description is rebuilt every frame). Read it the same
way livedelay/lagd_toggle.py does.
Claude-Session: https://claude.ai/code/session_01EGMnVnSk5inGTrd7kuDVG9
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com>
A fresh MR.ONE C3XL that was not yet authorized by the backend used to give
up after ~60s and boot into the OS with DongleId=UnregisteredDevice (the
60s hotfix return in the retry loop). From then on every boot skipped
registration entirely.
- remove the 60s give-up: keep retrying the registration screen until the
backend returns a valid dongle id
- only treat HTTP 200 + a real dongle_id as authorized; 402/403, other
statuses, bad JSON or a missing/unregistered dongle id all keep waiting
on the registration screen (\ contact MR.ONE\)
- a device with no key pair is likewise not authorized and stays on the
registration screen instead of booting in
- replace the bundled openpilot/selfdrive/modeld/models/driving_tinygrad.pkl
(compiled with an old tinygrad, unloadable by the current runtime) with the
freshly compiled CD210 pkl (vision+policy split, run_policy format)
- modeld_v2: fall back to the bundled default pkl when no active bundle is
selected, so a fresh install drives immediately even offline
- helpers: when no bundle is selected but the bundled default pkl exists, the
active model runner is tinygrad (modeld_v2), not stock modeld (which requires
a run_model-format pkl)
- models_manager: always run so the first-boot/upgrade default model (CD210)
download continues even when onroad (was only_offroad, stalling the download)
- modeld_v2: _pkl_exists now requires the pkl or every chunk file to exist; a
bare chunkmanifest is written eagerly for all catalog models and must not be
treated as downloaded (fixes loading half-downloaded models)
- models UI: only synthesize the Default row when the default model is not
already listed in the catalog (avoids two CD210 entries)
Port from master-dev (047ae41c0). Drops legacy pkl branch; warp/run_policy
read from metadata/run_policy + per-res warp (TSFDOM pkl is compatible).
after_enqueue hook for chestnut state send; fetcher chestnut catalog v24.
CI-only parts skipped.
Mirror upstream first-boot behavior: with nothing selected on qcom, queue
DEFAULT_MODEL_REF so the default model (CD210) is downloaded and activated
automatically, instead of falling back to the stock selfdrive modeld (which
needs a compile-format pkl that is not shipped here).
Downloaded/tinygrad-runner models are compiled with tinygrad e837e367a
(the pinned tinygrad_ref in the model catalogs). The old 66ee3cfb4
runtime crashes rendering their uops (uop/render.py TypeError), so the
device must ship this tinygrad for the new modeld_v2 pipeline.
Use TSFDOM (ref 0394d728...) as the default downloaded model so the
device runs modeld_v2 on the tinygrad runner instead of the stock
selfdrive modeld (which needs a local compile-format pkl).
commaai's carcontroller called actuators.as_builder(), but in sunnypilot
opendbc the actuators passed to CarController.update is already a mutable
builder, so this crashed onroad. Use it directly. Verified by replaying
6138 frames of real Haval H6 CAN: 0 errors, control commands generated.
The commaai PR was written against a non-sunnypilot CarStateBase/CarInterface.
Adapt it to c3xl-dev:
- CarState.get_can_parsers(CP, CP_SP)
- carstate.update returns (CarState, CarStateSP) and reads ret.deprecated.brake
- CarController.update(CC, CC_SP, CS, now_nanos)
- CarInterface.update unpacks (ret, ret_sp)
Without these the car interface crashed at runtime and the selected vehicle
showed as unavailable.
Adds the GWM brand (Haval H6 2019-26, full ACC/steering support):
- opendbc/car/gwm: brand interface, carstate, carcontroller, gwmcan, values
(adapted to sunnypilot CP_SP API and deprecated field group)
- car.capnp: SafetyModel.gwm @36
- values.py: GWM in the Platform union
- docs_definitions.py: CarHarness.gwm
- safety: gwm.h, SAFETY_GWM 36, registration (behind ALLOW_DEBUG)
- dbc generator for gwm_haval_h6_mk3, torque params for GWM_HAVAL_H6
- car_list.json: Haval H6 now appears in the vehicle selector
- rebuilt panda firmware with the GWM safety mode (DEV-dc833705)
Adds the MG brand (MG 5 EV 2021, dashcam-only) to c3xl-dev's opendbc:
- opendbc/car/mg: brand interface, carstate, carcontroller, mgcan, values
- car.capnp: SafetyModel.mg @35
- values.py: MG in the Platform union
- safety: mg.h, SAFETY_MG 35, registration (behind ALLOW_DEBUG)
- dbc/mg.dbc, torque override for MG_5_EV
- car_list.json: include dashcam-only platforms so MG appears in the
vehicle selector
- rebuilt panda firmware with the MG safety mode (DEV-a53d9321)
The SPI panda boot loop called recover_internal_panda() whenever the panda
did not appear within 20s after a reset. recover() erases both the bootstub
and app sectors (dfu.py program_bootstub erases sectors 0+1) before
reflashing, so a working panda that booted slowly lost its app firmware.
Fix:
- pandad.py: wait up to 60s for the panda, retry the normal reset 3x, and
only enter the ROM bootloader (recover) when the panda is confirmed in DFU
or all normal resets failed - preserving provisioning of blank boards.
- hardware.py: align recover_internal_panda() timing with the working manual
flash scripts (0.2s reset hold, 1s settle, keep BOOT0 high).
- spi.py: raise the SPI bootloader ack timeout from 0.01s to 0.1s so the DFU
flash reliably succeeds instead of erasing then failing.
Each drive item now shows download buttons for its qlog.zst and rlog.zst
(next to the existing HEVC/TS downloads). The /download endpoint accepts
file=qlog|rlog and names the file by drive time.
The upstream sync renames usbgpu params to chestnut (ChestnutActive,
ModelManager_ActiveBundleChestnut, etc.), so rebuild the params C library
for the new keys.
Rewrite the top MR.ONE release section in English only (Chinese removed due
to garbled display) and add the recent changes: GM ignition-over-CAN panda
fix, Avoid EPS Lockout, merged master-dev model/UI updates, and OSM map
deletion.
- Rebuild libparams_c.so so the new Mapd_ClearCache param (#1971) is usable
on-device without a rebuild.
- Regenerate cereal C++ bindings for the custom.capnp verifying enum added
by #1953, keeping generated bindings in sync with the schema.
Adds Chinese translations for the new dual-slot model menu strings:
Small Model / Big Model / Model Status, download/verify status labels,
and the big-model failover notes.
* uh, i did not commit anything all this time
* slideee to the left, cha cha
* lint lint
* ui: unify model source predicate and per-source bundle lookup in model_info
* [TIZI/TICI] ui: disable the other-model row onroad like the active row
* [TIZI/TICI] ui: drop docstring that restates the function name
* [TIZI/TICI] ui: keep Favorites as the first model folder in the picker
* ui: record why model names read the params slots and not modelManagerSP
* ui: show the default model's name on the picker Default entries
* models: bind a download to its ref so cancel and reselect work everywhere
* models: resume partial chunked downloads and verify silently
* models: publish a verifying status so cached checks read as verification, not a stuck download
* [TIZI/TICI] ui: move download status onto each model's own row
* [TIZI/TICI] ui: show the row status description while it has text
* [TIZI/TICI] ui: restore the Model Status bar row
* models: a cancel interrupts verification immediately and keeps on-disk chunks
* models: a selection made mid-download queues instead of cancelling the transfer
* [TIZI/TICI] ui: Model Status shows both slots idle and the queued pick while busy
* [TIZI/TICI] ui: label the Model Status slots small and big and scroll long names
* models: start a queued download in the same tick and label empty slots (Default)
* ui: scroll Model Status names at the corrected speed
* [TIZI/TICI] ui: Model Status shows the big model failing over to small
* [TIZI/TICI] ui: stable model rows and a runner-matched failover note on Model Status
* [TIZI/TICI] ui: model rows show full names and the failover note reopens with the page
* ui: name the actually driving model runner-matched and bring mici to state parity
* fix ugly
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com>
#1966 changes ModelManager params: drops DownloadIndex and the PrevBundle
keys, adds DownloadRef and ActiveBundleUSBGPU, and switches ActiveJson to
JSON type. Rebuild the params C library so the new keys work on-device
without a rebuild.
* models: dual-slot backend (qcom/usbgpu) with ref-based downloads
* models: restore get_active_source and the usbgpu-to-qcom fallback
* models: fix per-slot validation and cap mismatched-source refetches
* ui/models: select models by ref and seed the usbgpu slot on migration
* models: drop defensive attribute guards on capnp bundles
* models: remove vestigial fetcher state and dead fallbacks
* models: resolve the active bundle from the active source slot only
* models: pass the usbgpu kwarg through the modeld test stubs
* models: resolve the displayed model from the active slot in ui_state
* models: correct the validation memo type hint
* models: drop docstrings that restate the function name
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Extend the low-speed torque scaling from 4 m/s to 8 m/s and add steering
angle-based scaling (further reduction above 50 deg wheel angle) so the EPS
does not reject HCA on sharp 90+ degree turns taken at speed. Lower the
standstill torque floor from 80% to 60% and use a stronger torque dither
(3 units vs 1) when the toggle is on, to reset the EPS stuck-torque
protection timer.
Cherry-picked #1960 adds ModelManager_PrevBundle and
ModelManager_PrevBundle_USBGPU to params_keys.h, so rebuild the params C
library so the new keys are usable on-device without a rebuild.