Skip to content

omarrayyann/controls_challenge

This branch is 2 commits ahead of, 42 commits behind commaai/controls_challenge:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2aaf00f · May 17, 2024

History

20 Commits
May 17, 2024
Mar 26, 2024
Apr 5, 2024
Mar 29, 2024
May 14, 2024
Apr 19, 2024
May 14, 2024
Apr 5, 2024
Apr 19, 2024
Apr 19, 2024
Mar 26, 2024
May 14, 2024
May 14, 2024
May 14, 2024

Repository files navigation

Comma Controls Challenge!

Car

Machine learning models can drive cars, paint beautiful pictures and write passable rap. But they famously suck at doing low level controls. Your goal is to write a good controller. This repo contains a model that simulates the lateral movement of a car, given steering commands. The goal is to drive this "car" well for a given desired trajectory.

Geting Started

We'll be using a synthetic dataset based on the comma-steering-control dataset for this challenge. These are actual routes with actual car and road states.

# download necessary dataset (~0.6G)
bash ./download_dataset.sh

# Test this works
python tinyphysics.py --model_path ./models/tinyphysics.onnx --data_path ./data/00000.csv --debug --controller simple


# Batch Metrics on lots of routes
python tinyphysics.py --model_path ./models/tinyphysics.onnx --data_path ./data --num_segs 100 --controller simple

# Generate a report comparing two controllers
python eval.py --model_path ./models/tinyphysics.onnx --data_path ./data --num_segs 100 --test_controller simple --baseline_controller open

There's also a notebook at experiment.ipynb, to explore.

TinyPhysics

This is a "simulated car" that has been trained to mimic a very simple physics model (bicycle model) based simulator, given realistic driving noise. It is an autoregressive model similar to ML Controls Sim in architecture. It's inputs are the car velocity (v_ego), forward acceleration (a_ego), lateral acceleration due to road roll (road_lataccel), current car lateral acceleration (current_lataccel) and a steer input (steer_action) and predicts the resultant lateral acceleration fo the car.

Controllers

Your controller should implement an update function that returns the steer_action. This controller is then run in-loop, in the simulator to autoregressively predict the car's response.

Evaluation

Each rollout will result in 2 costs:

  • lataccel_cost: Σ ( a c t u a l l a t a c c e l t a r g e t l a t a c c e l ) 2 s t e p s 100

  • jerk_cost: Σ ( ( a c t u a l l a t a c c e l t a c t u a l l a t a c c e l t 1 ) / Δ t ) 2 s t e p s 1 100

It is important to minimize both costs. total_cost: ( l a t a c c e l c o s t 5 ) + j e r k c o s t

Submission

Run the following command, and send us a link to your fork of this repo, and the report.html this script generates.

python eval.py --model_path ./models/tinyphysics.onnx --data_path ./data --num_segs 5000 --test_controller <insert your controller name> --baseline_controller simple

About

My winning Reinforcement Learning solution to comma.ai controls challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 70.9%
  • Python 28.9%
  • Shell 0.2%