4.5 KiB
Core concepts
This page introduces the main features and modules in CARLA. Detailed explanations of the different subjects can be found in their corresponding page.
In order to learn about the different classes and methods in the API, take a look at the Python API reference. Besides, the Code recipes reference contains some common code chunks, specially useful during these first steps.
- First steps
- 1st. World and client
- 2nd. Actors and blueprints
- 3rd. Maps and navigation
- 4th. Sensors and data
- Advanced steps
!!! Important
This documentation refers to CARLA 0.9.X.
The API changed significantly from previous versions (0.8.X). There is another documentation regarding those versions that can be found here.
First steps
1st. World and client
The client is the module the user runs to ask for information or changes in the simulation. A client runs with an IP and a specific port. It communicates with the server via terminal. There can be many clients running at the same time. Advanced multiclient managing requires thorough understanding of CARLA and synchrony.
The world is an object representing the simulation. It acts as an abstract layer containing the main methods to spawn actors, change the weather, get the current state of the world, etc. There is only one world per simulation. It will be destroyed and substituted for a new one when the map is changed.
2nd. Actors and blueprints
An actor is anything that plays a role in the simulation.
- Vehicles.
- Walkers.
- Sensors.
- The spectator.
- Traffic signs and traffic lights.
Blueprints are already-made actor layouts necessary to spawn an actor. Basically, models with animations and a set of attributes. Some of these attributes can be customized by the user, others don't. There is a Blueprint library containing all the blueprints available as well as information on them.
3rd. Maps and navigation
The map is the object representing the simulated world, the town mostly. There are seven maps available. All of them use OpenDRIVE 1.4 standard to describe the roads.
Roads, lanes and junctions are managed by the Python API to be accessed from the client. These are used along with the waypoint class to provide vehicles with a navigation path.
Traffic signs and traffic lights have bounding boxes placed on the road. Vehicles become aware of them once inside their bounding box.
4th. Sensors and data
Sensors wait for some event to happen, and then gather data from the simulation. They call for a function defining how to manage the data. Depending on which, sensors retrieve different types of sensor data.
A sensor is an actor attached to a parent vehicle. It follows the vehicle around, gathering information of the surroundings. The sensors available are defined by their blueprints in the Blueprint library.
- Cameras (RGB, depth and semantic segmentation).
- Collision detector.
- Gnss sensor.
- IMU sensor.
- Lidar raycast.
- Lane invasion detector.
- Obstacle detector.
- Radar.
Advanced steps
Hereunder are listed some advanced CARLA features. However, it is highly encouraged to first take a closer look to the pages regarding the first steps in order to learn the basics.
- Recorder. Allows for reenacting previous simulations using snapshots of the world.
- Rendering options. Graphics quality settings, off-screen rendering and a no-rendering mode.
- Simulation time and synchrony. Everything regarding the simulation time and server-client communication.
- Traffic manager. This module is in charge of every vehicle set to autopilot mode. It simulates traffic in the city for the simulation to look like a real urban environment.
That is a wrap on the CARLA basics. The next step takes a closer look to the world and the clients connecting to it.
Keep reading to learn more. Visit the forum to post any doubts or suggestions that have come to mind during this reading.