Yo, it's Dom here đ. Family's everything to me, but today, I'm pulling over from the street races to drop some knowledge about setting up the CARLA simulator. We're about to step into a virtual world where precision meets adrenaline. Buckle up, because we're cruising through what CARLA is, why it's your ultimate driving ally, and how to set it up like a pro.
CARLA isn't just some fancy tool; it's the NOS of autonomous driving simulators. Built on Unreal Engine, this open-source bad boy helps you:
So, why the heck do we need CARLA? Well, these simulators are game-changers for anyone in autonomous driving. You wouldnât take your muscle car out on a high-speed chase without practicing first, right? The same goes for autonomous carsâthey need to be trained in different environments and situations, and that's where CARLA comes in.
We use simulators like CARLA for:
Without simulators, self-driving cars would be like a race car driver trying to learn by just jumping into a car and going 200 mph without practice. You need to test the machine before hitting the real world. And trust me, we donât want any bad surprises when weâre going full throttle.
Alright, now letâs get down to business. listen up! You wanna set up CARLA on a Linux VM? It's gonna be a wild ride, but I've got your back. Follow these steps like you're gunning for a 10-second quarter mile. Let's get this show on the road. đ„
First, hit up the CARLA GitHub repo to grab the carla-0.9.12-linux tarball. This is the start of your journey.
wget https://tiny.carla.org/carla-0-9-12-linux
You canât drive a car without a motor, right? This tarball's gonna be your engine. Now, letâs crack that tarball open and release the power inside. Run the command.
tar -xzvf carla-0.9.12-linux
If youâre running this on a beefy machine with a GPU (and you should be, because weâre going for high-speed performance here), we need to get the right drivers in place. Install the NVIDIA drivers:
sudo apt install nvidia-driver-535
Once the drivers are installed, youâve gotta give your system a little restart to make sure everything kicks into gear using sudo reboot.
After rebooting, make sure your NVIDIA drivers are running smooth. Run nvidia-smi.
Vulkan is your performance boost, just like nitrous on a muscle car. Install it with
sudo apt-get install vulkan-tools
We need all the performance we can get for this simulation. Think of Vulkan as your nitrous systemâhelps CARLA run smoother and faster.
You canât drive the machine if you canât see the road. For that, we need XQuartz to get the display working on your Mac. Download it from url and install it.
Now, you need to connect to your Linux VM from your Mac, with some special sauce (X11 forwarding). Use:
ssh -X <studentid>@host
Youâre not racing if you canât see the track. Set the display port like this:
export DISPLAY=:0
This ensures youâre looking at the right displayâyour virtual cockpit
For the system to know where to store the runtime files, do this:
export XDG_RUNTIME_DIR=/run/user/$(id -u)
Run this command to make sure everythingâs running like a well-oiled machine vulkaninfo.
To make sure your machine can talk to the CARLA simulator server, you're gonna need the CARLA Python client. Letâs get it installed fast, like we're revving up for a race. đ
Run this command in your terminal:
pip install carla
Alright, youâve done the hard work. Now itâs time to hit the gas! đ
Letâs fire up CARLA and see what this machine can do. Run the command below, and watch the magic happen. đđš
./CarlaUE4.sh -vulkan
Boom, you're in the driverâs seat. CARLAâs about to show you what real simulation looks like. Letâs roll! đ
If you hit an error saying it can't access the display, it's like your car's stuck in the garage and the door wonât open. đđ„ Time to unlock that door with:
xhost +local:root
if you're still facing display issues, let's put the pedal to the metal and get creative. đ„
Hit it with this command:
export DISPLAY=localhost:10.0
we need to get that simulator running on the cloud VM and beam it over to your local machine. Think of it like driving a car in the clouds and watching it on your own screen.
Weâre gonna use SSH tunneling to forward the port where the CARLA simulator is running in the VM to your local screen. It's like connecting the engine to the wheels. đïž
ssh -L <VM_simulator_port>:localhost:5901 <your_vm_username>@<vm_ip_address>
Now, you should be seeing the CARLA simulator on your local screen. Itâs like youâve got the wheel in your hands while the carâs on the cloud. đ©ïž
Just like how I always say, âI live my life a quarter mile at a time,â with CARLA, you can take your simulations step by step. Itâs not just about fast carsâitâs about using the right tools to get things done the right way. So, whether youâre testing driving policies, training perception algorithms, or just want to feel the thrill of autonomous driving, CARLAâs your ticket.
Now go out there, hit the gas, and get started with CARLA. Itâs a wild ride, but youâve got the skills to drive it home. đ
Familyâs got your back!
Hold tight because, in the next blog, weâll dive into adding cars, walkers, and more into CARLA. And who better to take the wheel for that than my close friend, right-hand man, and brother, Brian OâConner?
Stay tunedâheâs up next. đ„
Dominic Toretto, signing off. đïžđš
check Blog 2 of Carla Simulator.