Ryan Huang

F1TENTH autonomous car

I solo-built a 1/10-scale autonomous race car, from the parts list to GPU-accelerated localization and model predictive control.

4.47×faster localization after moving ray casting to the GPU
6autonomy algorithms built and tested on the real car
~5Klines of Python and C++, written alone
Role
Solo build
Period
Jan – May 2026
Stack
ROS 2 Humble, Jetson Orin Nano, RPLIDAR A2M12, VESC, Python, C++, CUDA
Reading
2 min

Why I built it#

I want to manage robotics products, and I didn't want my first robotics specs to describe systems I had never debugged. So I built one alone: chose the parts, assembled the car, and integrated every layer from the motor controller to the planner. The idea came out of a conversation with a professor at the UCLA Mobility Lab. The build and the code are mine.

The F1TENTH car on a desk, with a LiDAR sensor on the front and a Jetson computer with two antennas behind it
The finished car: the RPLIDAR at the front, the Jetson Orin Nano and its Wi-Fi antennas behind it.
PartWhat I used
ComputeNVIDIA Jetson Orin Nano (Super)
LiDARRPLIDAR A2M12, 15 Hz
Motor controllerVESC 6 (MK6)
TeleopPS5 DualSense

The race stack#

The car reads a LiDAR (RPLIDAR A2M12), wheel odometry from the VESC and an IMU, then runs four stages:

  1. SLAM. slam_toolbox builds the map with a pose graph and loop closure.
  2. Localization. A particle filter with 4,000 particles, ray casting on the GPU.
  3. Planning. A minimum-curvature raceline offline, Pure Pursuit online.
  4. Control. Pure Pursuit or linear MPC (12 steps of 0.1 s) sends speed and steering to the VESC.

The offline half turns a few laps of manual driving into a race plan. slam_toolbox builds the map, a medial-axis script extracts the track centerline, and a fork of TUM's minimum-curvature optimizer produces the raceline and its speed profile. The online half localizes against that map and follows the line.

Top view of the F1TENTH test track: walls from the SLAM map, the teleoperated recorded path, and the minimum-curvature raceline.1 m
  • Walls from the SLAM map
  • Path I drove by hand
  • Optimized raceline
Top view of the test track from the car's own SLAM map. The raceline has 75 points, a speed profile of 1.32 to 1.64 m/s and a 2.58 s lap.

Measured results#

WhatSetupResult
Ray casting on the CPU4,000 particles × 61 rays5.37 ms per update (186 Hz)
Ray casting on the GPU (CUDA, sm_87)Same1.20 ms per update (833 Hz), 4.47× faster
Optimized raceline75 points, 0.05 m step2.58 s lap at 1.32 to 1.64 m/s
CodebasePython and C++About 5,000 lines

Decisions worth explaining#

Two independent paths for the emergency brake#

Automatic emergency braking computes a time-to-collision for every LiDAR beam and brakes below 0.5 s. It publishes to the Ackermann mux at priority 200, above every driving algorithm, and also straight to the VESC. If the mux crashes or lags, the car would otherwise hold its last speed. The build log has the full reasoning.

RRT* over plain RRT#

Plain RRT finds a path quickly but rarely a good one. RRT*'s rewiring step converges toward the optimal path at a bounded cost per iteration. That trade is worth it on a car where compute isn't the bottleneck and path quality shows up in lap time.

Fix upstream code instead of working around it#

The stack needed three patches: an extra negation in the VESC driver that mirrored the odometry, a Python 3 and sm_87 port of range_libc's CUDA build, and a cvxopt shim for TUM's optimizer because the quadprog wheel is broken on aarch64.

Before the race stack#

I first worked through six classic autonomy labs on the same car: automatic emergency braking, PID wall following, Follow the Gap, Pure Pursuit, RRT* on a 0.1 m occupancy grid, and MPC solved with CVXPY and OSQP.

Follow the Gap. Reactive planning, up to 1.5 m/s
PID wall following

Status#

The offline pipeline is complete, and the online stack (particle filter plus MPC) passed its first single-lap test on 12 April 2026. Next is a larger track and a head-to-head benchmark of Pure Pursuit against MPC, which is waiting on track time.