Note 注意

You are not reading the most recent version of this documentation. 0.9.15 is the latest version available.
您没有阅读本文档的最新版本。0.9.15 是可用的最新版本。

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.
要了解 API 中的不同类和方法,请查看 Python API 参考。

Important 重要

This documentation refers to CARLA 0.9.X.
本文档参考 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.
该 API 与以前的版本 (0.8.X) 相比发生了重大变化。可以在此处找到有关这些版本的另一个文档。

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.
客户端是用户运行以请求模拟中的信息或更改的模块。客户端使用 IP 和特定端口运行。它通过终端与服务器通信。可以同时运行多个客户端。高级多客户端管理需要对 CARLA 和同步有透彻的了解。

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.
Actor 是在模拟中发挥作用的任何东西。

  • 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.
蓝图是生成 actor 所必需的 actor 布局。基本上,具有动画和一组属性的模型。其中一些属性可以由用户自定义,而另一些则不能。有一个蓝图库,其中包含所有可用的蓝图以及有关它们的信息。

3rd- Maps and navigation

The map is the object representing the simulated world, the town mostly. There are eight maps available. All of them use OpenDRIVE 1.4 standard to describe the roads.
地图是代表模拟世界的对象,主要是城镇。有八张地图可用。它们都使用 OpenDRIVE 1.4 标准来描述道路。

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.
道路、车道和交叉路口由 Python API 管理,可从客户端访问。它们与航点类一起使用,为车辆提供导航路径。

Traffic signs and traffic lights are accessible as carla.Landmark objects that contain information about their OpenDRIVE definition. Additionally, the simulator automatically generates stops, yields and traffic light objects when running using the information on the OpenDRIVE file. These have bounding boxes placed on the road. Vehicles become aware of them once inside their bounding box.
交通标志和交通信号灯可作为卡拉访问。包含有关其 OpenDRIVE 定义的信息的地标对象。此外,模拟器在使用 OpenDRIVE 文件上的信息运行时自动生成停车、让行和交通信号灯对象。这些在路上放置了边界框。一旦进入边界框,车辆就会意识到它们。

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.  Gnss 传感器。
  • IMU sensor.  IMU传感器。
  • Lidar raycast.  激光雷达光线投射。
  • Lane invasion detector.  车道入侵检测器。
  • Obstacle detector.  障碍物检测器。
  • Radar.  雷达。
  • RSS.  RSS的。

Advanced steps 高级步骤

CARLA offers a wide range of features that go beyond the scope of this introduction to the simulator. Here are listed some of the most remarkable ones. However, it is highly encouraged to read the whole First steps section before starting with the advanced steps.
CARLA 提供了广泛的功能,超出了模拟器简介的范围。这里列出了一些最引人注目的。但是,强烈建议在开始高级步骤之前阅读整个“第一步”部分。

  • OpenDRIVE standalone mode. Generates a road mesh using only an OpenDRIVE file. Allows to load any OpenDRIVE map into CARLA without the need of creating assets.
    OpenDRIVE 独立模式。仅使用 OpenDRIVE 文件生成道路网格。允许将任何OpenDRIVE映射加载到CARLA中,而无需创建资产。
  • PTV-Vissim co-simulation. Run a synchronous simulation between CARLA and PTV-Vissim traffic simulator.
    PTV-Vissim 协同仿真。在 CARLA 和 PTV-Vissim 流量模拟器之间运行同步仿真。
  • Recorder. Saves snapshots of the simulation state to reenact a simulation with exact precision.
  • Rendering options. Graphics quality settings, off-screen rendering and a no-rendering mode.
  • RSS. Integration of the C++ Library for Responsibility Sensitive Safety to modify a vehicle's trajectory using safety checks.
    RSS的。集成责任敏感安全的 C++ 库,以使用安全检查修改车辆的轨迹。
  • Simulation time and synchrony. Everything regarding the simulation time and server-client communication.
  • SUMO co-simulation. Run a synchronous simulation between CARLA and SUMO traffic simulator.
    SUMO协同模拟。在 CARLA 和 SUMO 交通模拟器之间运行同步模拟。
  • 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.
这是对 CARLA 基础知识的总结。下一步将更仔细地观察世界和与之相关的客户。

Keep reading to learn more. Visit the forum to post any doubts or suggestions that have come to mind during this reading.