This project is inspired by Nitin Kapania's Stanford PhD thesis, Final project for course 1 of the Coursera: Introduction to Self-Driving Cars, and Charlotte Dorn's Indianapolis waypoint tracking project . What if we run a vitual Audi TT in Thunderhill racetrack to test Kapania's path generation algorithm?
"Thunderhill Raceway Park is a motorsports complex located 7 miles West of Willows, California, United States, in the Sacramento Valley. It is the venue for the longest automobile race in the United States, the 25 Hours of Thunderhill, held annually during the first weekend in December.
Thunderhill has two tracks: the original 3 mile track known as Thunderhill East and a 2 mile track known as Thunderhill West. The two tracks can also be combined to offer a 5-mile track, the longest road course in America. Thunderhill also offers two large skid pad areas as well for drifting and car control events. ---- Source: Wikipedia"
Our Thunderhill but in CARLA 0.9.10
Real Thunderhill | Ours |
---|---|
![]() |
![]() |
"Shelley, as the self-driving car is known, is the product of collaboration between Stanford's Dynamic Design Lab, led by mechanical engineering Associate Professor Chris Gerdes, and the Volkswagen Electronics Research Lab. Earlier this summer, Gerdes' group brought Shelley to Thunderhill for high-speed tests of the latest tweaks to the software that tells her when to brake, how tight to take turns and when to punch the gas. ---- Source: Stanford Report"
Shelley, Stanford's Robotic Car, Hits the Track
Our replication is 50% of the max speed running by the pure pursuit lateral control method.
This replication is running by the Stanley lateral control method with max speed of 150 kph.
Copied from CARLA Documentation.
- Server side. A 4GB minimum GPU will be needed to run a highly realistic environment. A dedicated GPU is highly advised for machine learning. (Note: ours has three GTX 1080Ti, with 12GB for each GPU)
- Client side. Python is necessary to access the API via command line. Also, a good internet connection and two TCP ports (2000 and 2001 by default).
- System requirements. Any 64-bits OS should run CARLA. However, since release 0.9.9, CARLA cannot run in 16.04 Linux systems with default compilers. These should be upgraded to work with CARLA.
- Other requirements. Two Python modules:
Pygame to create graphics directly with Python, and Numpy for great calculus.
- Download CARLA 0.9.10 compiled package from here, choose CARLA_0.9.10.zip.
- Build your anaconda environment, dependency see envname.yml. Our environment is built with miniconda and a python=3.7 environment.
# Download your CARLA_0.9.10.zip
# Extract it
# Navigate to your carla folder
cd \your\path\to\carla\CARLA_0.9.10\WindowsNoEditor
CarlaUE4.exe
# Create an environment named py37 from YAML file
conda env create --file envname.yml
# Activate your environment
conda activate py37
you'll get
Remember, to import carla
, you always need to paste the the following before your any client scripts. The *.egg
include all necessary package to convert your python3.7 script into CARLA c++ environment. More about this issue, see this.
try:
sys.path.append(glob.glob('/your/path/to/carla/CARLA_0.9.10/WindowsNoEditor/PythonAPI/carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass
SRunner
edit PATH environment
Click the following picture, jump to OpenStreetMap in your browser.
Copy following code to view in HTML
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=-122.35038042068483%2C39.530773993553694%2C-122.32338666915895%2C39.546560835379374&layer=mapnik" style="border: 1px solid black"></iframe><br/><small><a href="https://www.openstreetmap.org/#map=16/39.5387/-122.3369">Check Larger Map</a></small>
"RoadRunner is an interactive editor that lets you design 3D scenes for simulating and testing automated driving systems. You can customize roadway scenes by creating region-specific road signs and markings. You can insert signs, signals, guardrails, and road damage, as well as foliage, buildings, and other 3D models. RoadRunner provides tools for setting and configuring traffic signal timing, phases, and vehicle paths at intersections.----MathWorks"
You can try my Colab notebook by click
While our simulation video uses the centerline of the track as the tracking target for the control algorithm, what Colab generates is the optimal path that simulates a real racer. In the follow-up work, it can be considered to import the optimized path into the simulation environment for testing, but the apex of the road model needs to be optimized.
# Use PurePursuit to control
python Try_w.py --control-method PurePursuit
# Use Stanley to control
python Try_w.py --control-method Stanley
# Use MPC to control
python Try_w.py --control-method MPC
Reference:
- Path following and path generation framework from Nitin Kapania's Stanford PhD packed in python
- Creating Carla Waypoints in an Indianapolis racetrack
- Shelley, Stanford's robotic racecar, hits the track
- Our Very Own Grand Challenge
- Three Methods of Vehicle Lateral Control: Pure Pursuit, Stanley and MPC
- ScenarioRunner Getting started
- Homepage of RoadRunner