CARLA
 
载入中...
搜索中...
未找到
SensorRegistry.h
浏览该文件的文档.
1// Copyright (c) 2022 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#ifndef LIBCARLA_SENSOR_REGISTRY_INCLUDE_H // 该头文件定义了传感器注册相关的内容,用于管理不同类型传感器及其序列化操作
8#define LIBCARLA_SENSOR_REGISTRY_INCLUDE_H
9// 引入CompositeSerializer头文件,它可能是一个用于组合多个序列化相关功能的类模板,
10// 在后续构建传感器数据序列化和反序列化的注册机制中会起到关键作用
12
13// =============================================================================
14// Follow the 4 steps to register a new sensor. // 以下是注册新传感器需要遵循的4个步骤相关的代码区域说明
15// =============================================================================
16
17// 1. Include the serializer here.
18#include "carla/sensor/s11n/CollisionEventSerializer.h" // 包含各种传感器对应的序列化器头文件,这些序列化器用于将传感器相关数据进行序列化操作
34
35// 2. Add a forward-declaration of the sensor here. // 对各种传感器类进行前置声明,告知编译器这些类在后续会被定义,避免编译时找不到类型定义的错误
36class ACollisionSensor;
37class ADepthCamera;
38class ANormalsCamera;
39class ADVSCamera;
40class AGnssSensor;
45class ARadar;
47class ARayCastLidar;
51class ARssSensor;
52class FWorldObserver;
55class AV2XSensor;
57
58namespace carla {
59namespace sensor {
60
61
62 // 3. Register the sensor and its serializer in the SensorRegistry. // 在SensorRegistry中注册传感器及其对应的序列化器,使得可以通过该注册表对相应传感器数据进行序列化和反序列化操作
63 /// Contains a registry of all the sensors available and allows serializing
64 /// and deserializing sensor data for the types registered. // 包含了所有可用传感器的注册表,允许对已注册类型的传感器数据进行序列化和反序列化操作
65 ///
66 /// Use s11n::NoopSerializer if the sensor does not send data (sensors that
67 /// work only on client-side). // 如果传感器不发送数据(仅在客户端工作的传感器),则使用s11n::NoopSerializer
69 std::pair<ACollisionSensor *, s11n::CollisionEventSerializer>,
70 std::pair<ADepthCamera *, s11n::ImageSerializer>,
71 std::pair<ANormalsCamera *, s11n::NormalsImageSerializer>,
72 std::pair<ADVSCamera *, s11n::DVSEventArraySerializer>,
73 std::pair<AGnssSensor *, s11n::GnssSerializer>,
74 std::pair<AInertialMeasurementUnit *, s11n::IMUSerializer>,
75 std::pair<ALaneInvasionSensor *, s11n::NoopSerializer>,
76 std::pair<AObstacleDetectionSensor *, s11n::ObstacleDetectionEventSerializer>,
77 std::pair<AOpticalFlowCamera *, s11n::OpticalFlowImageSerializer>,
78 std::pair<ARadar *, s11n::RadarSerializer>,
79 std::pair<ARayCastSemanticLidar *, s11n::SemanticLidarSerializer>,
80 std::pair<ARayCastLidar *, s11n::LidarSerializer>,
81 std::pair<ARssSensor *, s11n::NoopSerializer>,
82 std::pair<ASceneCaptureCamera *, s11n::ImageSerializer>,
83 std::pair<ASemanticSegmentationCamera *, s11n::ImageSerializer>,
84 std::pair<AInstanceSegmentationCamera *, s11n::ImageSerializer>,
85 std::pair<FWorldObserver *, s11n::EpisodeStateSerializer>,
86 std::pair<FCameraGBufferUint8 *, s11n::GBufferUint8Serializer>,
87 std::pair<FCameraGBufferFloat *, s11n::GBufferFloatSerializer>,
88 std::pair<AV2XSensor *, s11n::CAMDataSerializer>,
89 std::pair<ACustomV2XSensor *, s11n::CustomV2XDataSerializer>
90
91
92 >;
93
94} // namespace sensor
95} // namespace carla
96
97#endif // LIBCARLA_SENSOR_REGISTRY_INCLUDE_H
98
99#ifdef LIBCARLA_SENSOR_REGISTRY_WITH_SENSOR_INCLUDES
100
101// 4. Include the sensor here. // 包含实际的传感器类定义的头文件,这些头文件中定义了各种传感器类的具体实现等内容
111#include "Carla/Sensor/Radar.h"
121
122#endif // LIBCARLA_SENSOR_REGISTRY_WITH_SENSOR_INCLUDES
用于记录碰撞的传感器。
产生动态视觉事件的传感器
Definition DVSCamera.h:52
Sensor that produces "depth" images.
Definition DepthCamera.h:18
GNSS传感器表示类 实际的位置信息计算是在服务器端进行的
Definition GnssSensor.h:24
Sensor that produces "Instance segmentation" images.
LaneInvasion sensor representation The actual position calculation is done one client side
Sensor that produces "normals" images.
A sensor to register collisions.
Sensor that produces "optical flow" images.
A ray-cast based Radar sensor.
Definition Radar.h:22
一个基于光线投射的激光雷达传感器类。
A ray-cast based Lidar sensor.
RSS sensor representation The actual calculation is done one client side
A sensor that captures images from the scene.
Sensor that produces "semantic segmentation" images.
Serializes and sends all the actors in the current UCarlaEpisode.
编译时映射表,用于将传感器对象映射到序列化器。
CARLA模拟器的主命名空间。
Definition Carla.cpp:139