Live demo · Localization

Compare lane localization on Chalk CPUs

This demo shows how to run a localization simulation on Chalk CPUs to compare GPS filtering, map matching, landmark SLAM and lane estimates. Choose GPS conditions to try it, then explore the code to see how it works.

See what each localization stage adds

Compare position estimates against the simulated true car on the same drive.

Try this experiment · expected results

  1. 1Compare stages on one drive

    Choose GPS conditions, then toggle the stages in the table without starting a new drive.

    Expected: The dashed error lines and error table show the differences under the same sensor noise.

  2. 2Zoom to a lane

    Switch from Area to Street to Lane and compare the final estimate with the true car.

    Expected: Road matching and lane placement solve different parts of the localization problem.

kalman · hmm · graph slamOpen in new tab

Compare simulated location estimates as GPS gets noisier. Chalk hosts the CPU service that combines GPS, motion sensors, road matching, landmarks, and lane information.

Roads, lanes and one-way rules are from OpenStreetMap (© OpenStreetMap contributors, ODbL). The drive and every sensor reading are simulated. Landmark identities are supplied to the estimator, fleet maps average separate mapping runs, and lane geometry is derived from road centrelines at a fixed width. The scores describe this simulation.

The Kalman filter smooths GPS noise, map matching selects a road, landmark SLAM reduces position bias, and the lane model uses simulated camera markings to choose a lane. In the reference evaluation of 20 simulated urban-canyon drives, median RMS error falls from 10.5 m for GPS to 1.2 m with all stages, with 97% of positions in the correct lane.

Built on Chalk

NumPy and SciPy implement the estimators, and the simulator supplies sensor readings and ground truth. Chalk runs the CPU service, mounts its map data and checks that startup has finished.

  • Run on two vCPUs

    Chalk schedules the NumPy and SciPy application with two vCPUs and 4 GiB of memory. This example runs entirely on CPUs.

  • Mount the map with the code

    Chalk mounts the application and its OpenStreetMap extract as a volume, so the service starts with the map it needs.

  • Wait for the map to be ready

    The application builds a landmark map from 60 simulated drives at startup. Chalk checks its status endpoint before routing traffic to the replica.

  • Serve the viewer and API

    Chalk gives the scaling group an HTTPS endpoint. The example serves the map viewer and computes each drive through its Python API.

Deploy your own

Run it on your own

You need uv, Chalk credentials, and a Chalk environment. Clone the example and run the offline scorer to compare all four stages, or log in and deploy the interactive CPU service. The script prints the demo URL.

The estimators are an EKF, a Viterbi map matcher, a sparse pose-graph solver and a lane HMM. To use other maps or traces, adapt the example's inputs and evaluate the results against suitable ground truth.

chalk-ai/gps-lane-localization
git clone https://github.com/chalk-ai/gps-lane-localization
cd gps-lane-localization

# Score every stage over 20 simulated drives, offline.
./evaluate.py --profile urban-canyon --drives 20

# Or deploy the interactive demo (CPU only) and print its URL.
chalk login
./deploy.py

Build your localization pipeline

Map matching, fleet mapping, and the features built on top of them. Talk to an engineer about running your localization stack in your own cloud.