Project Info
Our project is for retrofitting any existing car to make it self-driving. Self-driving should not just be limited to new vehicles, Teslas, and Waymos, but cars bought before self-driving was available too. In our project, we take a 2018 Honda Accord and give it the ability to drive itself using commercially available hardware and open-source software. Using our app, you can request a ride and the car will come to where you are and drive you there. How We Built It The central design problem is that driving requires two very different kinds of intelligence. Understanding a scene - recognizing that a pedestrian is about to cross, or that a lane is ending - requires slow, contextual reasoning over visual input. Actually holding a lane and applying the brakes smoothly requires fast, high-frequency control. Trying to do both in a single system forces a tradeoff between intelligence and reaction speed, so we separated them into two layers. The high-level reasoning layer runs NVIDIA's Alpamayo R1, a 10.5-billion parameter vision-language-action model. It takes in camera frames from a wide-angle and a telephoto camera along with a short history of the car's own motion, and produces high-level driving plans. Because Alpamayo is a language model at its core, it also generates natural language explanations of its decisions - the same model that decides to yield to oncoming traffic can tell a passenger why it's yielding. This dual capability is what powers the transparency features in our rider-facing iOS app. The low-level control layer is derived from sunnypilot, a fork of comma.ai's openpilot. It runs a vision model that processes camera frames at 20 Hz and a control loop that actuates steering and acceleration at 100 Hz. These fast reflexes handle the moment-to-moment driving - lane holding, smooth braking, correcting for disturbances - while the reasoning layer above sets the overall plan. Both layers, along with several supporting processes, run independently on our compute platform and communicate through comma.ai's cereal IPC messaging framework. To physically control the car, we use the comma.ai Red Panda, a bidirectional CAN bus adapter connected to the Honda through a vehicle-specific wiring harness. Our software translates driving commands into CAN bus frames that the Honda's systems understand — steering torque, acceleration, braking — and sends them to the Red Panda, which transmits them onto the car's internal network. Vehicle state flows back through the same path, keeping the software in sync with what the car is actually doing. The system runs on an NVIDIA Jetson AGX Thor, with cameras connected through the Holoscan Sensor Bridge, which routes uncompressed video directly into GPU memory for minimal latency processing. The iOS app serves as both a rideshare dispatch system and a transparency interface. Riders request pickups, and the car navigates to them. During the ride, the app displays a live feed of the system's reasoning — what it sees, what it's doing, and why — drawn directly from Alpamayo's language output. In a driverless context, this kind of visibility is a practical necessity. Challenges One of the most difficult challenges was striking the balance between a performant and optimized model and one that actually performed well. Our hope was to run Chain of Causation models in real time on the AGX Thor with around 10hz control frequency, but these models were well over 2B parameters which made it essentially impossible to run under the 100ms per cycle compute time limit. Especially given the memory bandwidth cap of 276GB/s this made memory loading time on autoregressive chain of causation models to be a massive bottleneck. Without a custom ptx kernel that would do essentially what Flash Attention did - completely removing multiple memory read and write steps to work around memory bottlenecks. The hardest part of this project was integration. Each individual component — the reasoning model, the control software, the CAN bus interface, the camera pipeline — works on its own. Getting them all to work together reliably was where the real difficulty lay. The most fundamental challenge was bridging the two timescales of our architecture. The reasoning model takes hundreds of milliseconds to process a scene. The control loop needs to respond every ten milliseconds. Designing the handoff so that slow plan updates translate into smooth, continuous actuation — without jerks or gaps — required careful work on buffering, timing, and interpolation between the two systems. Hardware integration was equally demanding. Our stack spans four ecosystems — NVIDIA, Lattice Semiconductor, comma.ai, and Honda — each with its own data formats, protocols, and assumptions. Sunnypilot was built for Android with comma.ai's own cameras; we had to adapt it to Linux, swap in different camera sensors with different calibrations, route data through the Holoscan bridge, and make it all talk to the same CAN bus interface. Every boundary between ecosystems was its own set of problems. Finally, we had to ensure that generating natural language explanations from the reasoning model never interfered with the driving task. The language output runs as a secondary, asynchronous process — useful for riders, but never in the critical path of vehicle control. The car, which is controlled by the Jetson Thor, uses MQTT to communicate with the iPhone app through an MQTT broker, which is a Google Compute Engine instance. Safety Building a system that physically controls a moving vehicle carries obvious responsibility, and safety considerations informed our architecture from the start. The Red Panda firmware validates every CAN frame before transmitting it to the car. Malformed or out-of-range commands are rejected at the hardware level before they ever reach the vehicle's systems. On the camera side, the Holoscan Sensor Bridge and Lattice FPGA board provide a deterministic data path from the IMX274 cameras over MIPI to GPU memory - there is no software bottleneck or unpredictable CPU scheduling in the way of incoming visual data, which reduces the risk of stale or dropped frames reaching the driving model. On the software side, sunnypilot inherits openpilot's safety model: the driver can always override the system by touching the steering wheel or pressing the brake, which immediately disengages autonomous control. The system monitors for driver attentiveness and will alert and disengage if the driver is unresponsive for too long. Our two-layer architecture also provides a natural safety boundary. The low-level controller operates independently of the reasoning model - if Alpamayo stalls or produces an unreasonable plan, the fast control loop continues to hold the lane and maintain safe following distance using its own visual perception. The reasoning layer can fail gracefully without the car losing basic control. For the rideshare context, the iOS app gives passengers direct access to the reasoning layer. Riders can see a live interpretation of the system's actions - why it's slowing down, why it chose a particular lane, what it's anticipating ahead. This goes beyond passive status updates: because Alpamayo is a language model, passengers can actually converse with the system, ask questions about its decisions, and provide feedback. If a rider prefers a different route or wants to understand why the car is taking a particular path, they can say so, and the model can process that input as part of its planning. The app also enhances navigation by surfacing the model's contextual awareness - not just turn-by-turn directions, but an understanding of traffic conditions, road geometry, and obstacles that inform routing decisions. The result is that riders don't just observe autonomy - they interact with it, understand its thinking, and have a channel to influence it. We treat this project as a research prototype, not a production deployment. All testing was conducted in controlled conditions with a safety driver behind the wheel at all times. What We Learned Hardware is hard. There's a bunch of firmware issues, driver issues, and just a bunch of other risks that pose challenges. We developed a working familiarity with the NVIDIA autonomous driving ecosystem - Alpamayo, Cosmos, Holoscan, and JetPack - and with the comma.ai open-source stack for vehicle control. The gap between a model that works in simulation and a car that physically turns its steering wheel is large, and it is almost entirely composed of integration engineering. Our goal is to distill Alpamayo down to a model small enough to run directly on the Jetson AGX Thor in real time. W For on-device inference, we are using Thunder Kittens and TensorRT-Edge-LLM to write hyper-optimized CUDA kernels targeting a quantized version of the distilled model in NVFP4 (4-bit floating point). This combination should allow us to hit real-time inference on the Thor's Blackwell GPU, as well as cheaper hardware. We should note that the main bottleneck we'll be solving with custom kernels is memory bandwidth, and not compute. Stay tuned for future updates.
treehacks2026
Autonomous vehicle platform running on the NVIDIA Jetson AGX Thor to drive a Honda Bosch vehicle. Built at TreeHacks 2026.
Hardware
- Compute: NVIDIA Jetson AGX Thor (JetPack 7.1, CUDA 13.0, L4T R38.4.0)
- Cameras: Two IMX274 cameras via Holoscan Sensor Bridge — 90° FOV (road) and 120° FOV (wide)
- IMU: LSM6DSOX via Arduino → USB-UART at 104 Hz
- GPS: Adafruit Ultimate GPS FeatherWing via USB-UART at 10 Hz
- Vehicle: Honda Bosch platform via red panda OBD-II adapter
Architecture
Cameras → CUDA warp/YUV (CuPy) → driving_vision.onnx → driving_policy.onnx → controlsd → pandad → CAN bus → Honda
↑
IMU (104Hz) → locationd (Kalman) → livePose ────────────────────────────────────────┘
GPS (10Hz) → navd (Valhalla offline routing) → NavDesire → desire_helper ──────────┘
What We Built
ONNX Runtime on CUDA
- Built a compatible onnxruntime wheel for Jetson Thor (aarch64, CUDA 13.0) using jetson-containers
- All three models run on GPU with
ORT_ENABLE_ALLgraph optimization +EXHAUSTIVEcuDNN algo search
| Model | Avg Latency | Output |
|---|---|---|
driving_vision.onnx | 7.06 ms | [1,1576] fp16 |
driving_policy.onnx | 0.93 ms | [1,1000] fp16 |
dmonitoring_model.onnx | 3.83 ms | [1,551] fp16 |
| Total driving pipeline | ~8 ms | Well within 50ms (20Hz) budget |
CUDA Preprocessing
Replaced the entire OpenCL pipeline with CuPy CUDA kernels:
warpPerspectiveCUDA RawKernel — bilinear interpolation perspective warploadyuv— YUV420 channel packing via CuPy array slicingDrivingModelFrame/MonitoringModelFrame— full temporal buffer management
ONNX-Based Model Runner
Replaced tinygrad/OpenCL model runner with ONNX Runtime + CUDA sessions for both the driving model and driver monitoring model.
Camera Integration via Holoscan Sensor Bridge (holoscan-sensor-bridge/)
Two IMX274 cameras are connected to the Jetson AGX Thor through a Lattice CPNX100 Holoscan Sensor Bridge board. The FPGA bridges MIPI camera data to 10GbE UDP, which ConnectX NICs can write directly into GPU memory via RDMA.
FPGA firmware flashing: The Lattice CPNX100 board requires its FPGA bitstream to be programmed before use. This is done from inside the Holoscan Sensor Bridge Docker container:
# 1. Connect ethernet from Jetson to the sensor bridge board (J6 for cam 0, J3 for cam 1)
# 2. Verify connectivity
ping 192.168.0.2
# 3. Launch the Holoscan Sensor Bridge Docker container
cd holoscan-sensor-bridge
xhost +
sh docker/demo.sh
# 4. Flash the FPGA bitstream to on-board SPI flash (~50 min)
# Use --force if upgrading from an older bitstream version
program_lattice_cpnx100 scripts/manifest.yaml
# 5. Program the FPGA from the SPI flash (~1 min)
# The board must be power-cycled after programming
The flash tool (tools/program_lattice_cpnx100/) programs both the CLNX17 (MIPI bridge) and CPNX100 (main 10GbE) FPGAs via SPI, with MD5 checksum verification and automatic firmware download.
Camera pipeline:
- Holoscan captures frames inside Docker, converts RGBA uint16 → NV12 uint8 via a CuPy CUDA kernel
- Frames are passed to the host through a lock-free
/dev/shmring buffer (4 slots, sequence-counter torn-read detection) - Host-side
jetson_cameradpublishes via VisionIPC + cereal at 20 Hz - Camera 0 (90° FOV) → road camera, Camera 1 (120° FOV) → wide camera
IMU Integration
- LSM6DSOX IMU → Arduino (I2C) → CP2104 USB-UART →
/dev/IMU - Publishes accelerometer + gyroscope at 104 Hz
- Fully integrated with locationd Kalman filter:
sensorsOK,inputsOK,validall 100%
GPS Integration
- Adafruit Ultimate GPS via USB-UART →
/dev/GPS - Publishes GPS location at 10 Hz with speed and bearing
Navigation (Valhalla + NavDesire)
- Offline turn-by-turn routing using
pyvalhallawith Stanford-area OSM data - GPS map matching → maneuver tracking → desire inputs (turnRight, turnLeft, keepLeft, keepRight)
- Pipeline: GPS → navd → NavDesire → desire_helper → desire_pulse → driving_policy.onnx
Mobile App — Ride Hailing (mobileApp/)
A native iOS app (SwiftUI) that lets users hail the autonomous vehicle, similar to the Waymo rider app. The phone and car communicate over MQTT via a VPS broker.
Ride flow:
- User sets a destination and pickup location (search, recommended spots, or map pin)
- App sends a
from-phone/command-carMQTT message with pickup/destination coordinates - Car drives to pickup — app tracks the car's live GPS position on a map
- Car sends
from-car/car-arrived— user taps "Start Driving" - App sends
from-phone/start-ride— car drives to destination - Car sends
from-car/ride-finished— ride complete
Features:
- Real-time car location tracking via MQTT GPS updates
- MapKit route visualization and address autocomplete (scoped to Stanford campus)
- Ride phase UI (approaching → arrived → driving → reached destination)
- Car diagnostics tab with live MQTT message log and connection status
- Auto-reconnecting MQTT client (CocoaMQTT)
H100 Cloud Server (mqtt-server/)
We run an NVIDIA H100 GPU instance on Google Cloud (A3 machine type, 80GB HBM3) that serves as the central hub connecting the car, the mobile app, and the Alpamayo model.
Server setup: The server runs three services:
- Mosquitto MQTT broker (port 1883) — message bus connecting all components (car, phone, server)
- FastAPI application (port 8000) — WebSocket endpoints for data ingestion and video relay
- Alpamayo R1 inference — loaded at startup, runs periodically on buffered frames
# On the H100 instance
cd mqtt-server
pip install -r requirements.txt
PYTHONPATH=/path/to/alpamayo/src uvicorn server.main:app --host 0.0.0.0 --port 8000
What the server does:
- Data ingestion (
/ws/thor): The Jetson Thor streams JPEG camera frames + ego-motion data (orientation quaternion, velocity vector fromlivePose) over a msgpack WebSocket at ~10 Hz. The server buffers these in a thread-safe ring buffer, selecting frames at ~100ms intervals for inference. - MQTT relay: Subscribes to
from-phone/*andfrom-car/*topics, forwards commands between phone and car (e.g. routingfrom-phone/command-car→from-server/command-car), and auto-accepts hail requests with the car's latest GPS position. - Alpamayo inference: Every ~5 seconds, takes a snapshot of 4 buffered frames + 16 ego-motion history steps and runs Alpamayo R1 inference. Publishes Chain-of-Causation reasoning and trajectory predictions to MQTT.
- Video relay (
/ws/mobile/video): Forwards the latest JPEG frame from the car to connected mobile clients at ~5 FPS.
Cloud Inference with Alpamayo (alpamayo/)
We run NVIDIA Alpamayo R1 (10B parameter Vision-Language-Action model) on the H100 server to provide high-level scene reasoning alongside the on-device driving stack.
How it works:
- The Jetson Thor streams camera frames + ego-motion data (orientation, velocity from
livePose) to the H100 server over a WebSocket at ~10 Hz - The server buffers frames and runs Alpamayo inference every few seconds
- Alpamayo produces two outputs:
- Chain-of-Causation (CoC) reasoning — a natural language explanation of what the car sees, why it's making decisions, and causal relationships between scene elements (e.g. "The lead vehicle is braking because a pedestrian is crossing, so I should decelerate")
- Trajectory prediction — 64 waypoints over a 6.4s horizon at 10 Hz, generated via flow-matching diffusion conditioned on the VLM's reasoning
- Results are published over MQTT (
from-server/coc-reasoning,from-server/trajectory) - The mobile app subscribes to these topics and displays the CoC reasoning in real time, so the rider can see why the car is doing what it's doing
Pipeline:
Thor cameras + livePose → WebSocket (msgpack) → H100 server → Alpamayo R1 → CoC + trajectory → MQTT → mobile app
The server also relays a live JPEG video feed from the car to the app via a second WebSocket endpoint.
On-Device Alpamayo Distillation (Coming Soon)
Running Alpamayo on a remote H100 works, but introduces network latency and a dependency on cloud connectivity — not ideal for a safety-critical driving system. Our goal is to distill Alpamayo R1 down to a model small enough to run directly on the Jetson AGX Thor in real time.
This is a significant undertaking. Alpamayo R1 is a 10B parameter Vision-Language-Action model with two distinct components that both need to be preserved through distillation:
- A VLM backbone (Cosmos-Reason) that generates Chain-of-Causation reasoning from multi-camera video + ego-motion history
- A flow-matching diffusion action decoder that produces trajectory predictions conditioned on the VLM's reasoning
Distilling a model of this scale while retaining both the reasoning quality and the trajectory accuracy — especially on long-tail driving scenarios where CoC reasoning matters most — requires careful multi-stage training and extensive validation.
For on-device inference, we are using Thunder Kittens and TensorRT-Edge-LLM to write hyperoptimized CUDA kernels targeting a quantized version of the distilled model in NVFP4 (4-bit floating point). This combination should allow us to hit real-time inference on the Thor's Blackwell GPU.
Stay tuned for future updates.
Platform Integration
- Hardware detection via
/JETSONmarker file - C++ pandad binary compiled for aarch64 — connects to red panda over USB
- All Cython extensions compiled for aarch64
End-to-End Latency
| Stage | Avg | p95 |
|---|---|---|
| CUDA preprocess (both cams) | 1.81 ms | 2.22 ms |
| Vision ONNX inference | 5.33 ms | 8.40 ms |
| Policy ONNX inference | 1.22 ms | 1.74 ms |
| Total driving pipeline | 8.66 ms | 12.34 ms |
| Driver monitoring (preprocess + inference) | 4.15 ms | 4.39 ms |
| Budget (20 Hz) | 50 ms | ~39 ms headroom |
Remaining
- Honda Bosch CAN interface: Connect red panda, verify CAN read/write with Honda ECUs
- Full system integration test: All subsystems running simultaneously on Jetson with live CAN
MQTT Topics
Topic: from-phone/command-car
Payload: {"timestamp":...,"pickup":{"longitude":...,"latitude":...},"destination":{"name":"...","longitude":...,"latitude":...}}
Topic: from-phone/start-ride
Payload: null
Topic: from-car/ride-finished
Running
sudo PYTHONPATH=/home/subha/.local/lib/python3.12/site-packages python3 main.py
Analysis
View
Metric
- 26
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CIn code
- C++In code
- CSSIn code
- FastAPIIn code
- FlaskIn code
- HTMLIn code
- Hugging FaceIn code
- JavaScriptIn code
- OpenAIIn code
- PythonIn code
- PyTorchIn code
- RedisIn code
- RustIn code
- SwiftIn code
14 of 14 appear in the indexed code.
AI coding agents
- Claude CodeConfig
- CodexConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
82 MB
Source files
7,355
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
bryandong24/treehacks2026
4,000 files · 28.4 MB · @ 5fe4cc0
Structure
Interface
130 files · 3%Screens, components and styles rendered to the user.
API & routing
8 files · 0%Request entry points: routes, handlers and controllers.
Application logic
2,336 files · 58%Domain rules, services and shared utilities.
+19 moreData & schema
16 files · 0%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- C41%
- Python30%
- Markdown13%
- YAML5%
- Shell4%
- CSS3%
- Other (3)4%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
openpilot/pyproject.toml
pypi · 59- aiohttp
- aiortc
- casadi
- cffi
- crcmod-plus
- Cython
- inputs
- jeepney
- json-rpc
- libusb1
- mapbox-earcut
- numpy
- onnx
- psutil
- pyaudio
- pycapnp
- pycryptodome
- PyJWT
- +41 more
sunnypilot/pyproject.toml
pypi · 59- aiohttp
- aiortc
- casadi
- cffi
- crcmod-plus
- Cython
- inputs
- jeepney
- json-rpc
- libusb1
- mapbox-earcut
- numpy
- onnx
- psutil
- pyaudio
- pycapnp
- pycryptodome
- PyJWT
- +41 more
openpilot/tinygrad_repo/pyproject.toml
pypi · 5050 development-only dependencies.
jetson-containers/packages/diffusion/diffusion_policy/requirements.txt
pypi · 38- accelerate
- av
- boto3
- cffi
- click
- datasets
- diffusers
- dill
- dm-control
- einops
- gdown
- gym
- h5py
- hydra-core
- imagecodecs
- imageio
- imageio-ffmpeg
- ipykernel
- +20 more
openpilot/opendbc_repo/pyproject.toml
pypi · 26- crcmod-plus
- numpy
- pycapnp
- pycryptodome
- scons
- tqdm
- +20 more
sunnypilot/opendbc_repo/pyproject.toml
pypi · 26- crcmod-plus
- numpy
- pycapnp
- pycryptodome
- scons
- tqdm
- +20 more
openpilot/msgq_repo/pyproject.toml
pypi · 14- codespell
- coverage
- cppcheck
- cpplint
- Cython
- lefthook
- numpy
- parameterized
- pytest
- pytest-retry
- ruff
- scons
- setuptools
- ty
openpilot/panda/pyproject.toml
pypi · 14- libusb1
- opendbc
- +12 more
sunnypilot/msgq_repo/pyproject.toml
pypi · 14- codespell
- coverage
- cppcheck
- cpplint
- Cython
- lefthook
- numpy
- parameterized
- pytest
- pytest-retry
- ruff
- scons
- setuptools
- ty
sunnypilot/panda/pyproject.toml
pypi · 14- libusb1
- opendbc
- +12 more
jetson-containers/packages/pytorch/requirements.txt
pypi · 13- build[uv]
- expecttest
- filelock
- fsspec
- hypothesis
- jinja2
- lintrunner
- networkx
- optree
- psutil
- sympy
- typing-extensions
- wheel
alpamayo/pyproject.toml
pypi · 12- accelerate
- av
- einops
- flash-attn
- hydra-colorlog
- hydra-core
- pandas
- physical_ai_av
- pillow
- torch
- torchvision
- transformers
jetson-containers/requirements.txt
pypi · 10- black
- flake8
- git
- packaging
- pre-commit
- pyyaml
- requests
- tabulate
- termcolor
- wget
openpilot/rednose_repo/requirements.txt
pypi · 10- cffi
- Cython
- numpy
- pre-commit
- pytest
- pytest-xdist
- ruff
- scipy
- scons
- sympy
sunnypilot/rednose_repo/requirements.txt
pypi · 10- cffi
- Cython
- numpy
- pre-commit
- pytest
- pytest-xdist
- ruff
- scipy
- scons
- sympy
openpilot/teleoprtc_repo/pyproject.toml
pypi · 9- aiohttp
- aiortc
- av
- numpy
- +5 more
sunnypilot/teleoprtc_repo/pyproject.toml
pypi · 9- aiohttp
- aiortc
- av
- numpy
- +5 more
jetson-containers/packages/vlm/vila-microservice/src/requirements.txt
pypi · 8- fastapi
- flask
- pillow
- prometheus_client
- pydantic-settings
- redis
- uvicorn[standard]
- websockets
mqtt-server/requirements.txt
pypi · 7- fastapi
- msgpack
- paho-mqtt
- Pillow
- scipy
- uvicorn[standard]
- websockets
jetson-containers/packages/llm/local_llm/requirements.txt
pypi · 6- flask
- getch
- tabulate
- termcolor
- tqdm
- websockets
jetson-containers/packages/llm/sudonim/patches/250314/requirements.txt
pypi · 6- absl-py
- fastapi
- pydantic
- sse_starlette
- starlette
- uvicorn
jetson-containers/packages/llm/llamaspeak/requirements.txt
pypi · 5- flask
- nvidia-riva-client
- termcolor
- tones
- websockets
openpilot/tinygrad_repo/extra/remu/Cargo.toml
cargo · 3- half
- num-traits
- +1 more
sunnypilot/tinygrad_repo/extra/remu/Cargo.toml
cargo · 3- half
- num-traits
- +1 more
mqtt-listen/requirements.txt
pypi · 1- paho-mqtt
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This repository has more files than are indexed here, so the diagram and browser show a partial tree. Open it on GitHub for the complete structure.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.