CARLA
SensorRegistry.h
Go to the documentation of this file.
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 
11 
12 // =============================================================================
13 // Follow the 4 steps to register a new sensor.
14 // =============================================================================
15 
16 // 1. Include the serializer here.
32 
33 // 2. Add a forward-declaration of the sensor here.
34 class ACollisionSensor;
35 class ADepthCamera;
36 class ANormalsCamera;
37 class ADVSCamera;
38 class AGnssSensor;
42 class AOpticalFlowCamera;
43 class ARadar;
45 class ARayCastLidar;
49 class ARssSensor;
50 class FWorldObserver;
51 struct FCameraGBufferUint8;
52 struct FCameraGBufferFloat;
53 
54 namespace carla {
55 namespace sensor {
56 
57  // 3. Register the sensor and its serializer in the SensorRegistry.
58 
59  /// Contains a registry of all the sensors available and allows serializing
60  /// and deserializing sensor data for the types registered.
61  ///
62  /// Use s11n::NoopSerializer if the sensor does not send data (sensors that
63  /// work only on client-side).
64  using SensorRegistry = CompositeSerializer<
65  std::pair<ACollisionSensor *, s11n::CollisionEventSerializer>,
66  std::pair<ADepthCamera *, s11n::ImageSerializer>,
67  std::pair<ANormalsCamera *, s11n::NormalsImageSerializer>,
68  std::pair<ADVSCamera *, s11n::DVSEventArraySerializer>,
69  std::pair<AGnssSensor *, s11n::GnssSerializer>,
70  std::pair<AInertialMeasurementUnit *, s11n::IMUSerializer>,
71  std::pair<ALaneInvasionSensor *, s11n::NoopSerializer>,
72  std::pair<AObstacleDetectionSensor *, s11n::ObstacleDetectionEventSerializer>,
73  std::pair<AOpticalFlowCamera *, s11n::OpticalFlowImageSerializer>,
74  std::pair<ARadar *, s11n::RadarSerializer>,
75  std::pair<ARayCastSemanticLidar *, s11n::SemanticLidarSerializer>,
76  std::pair<ARayCastLidar *, s11n::LidarSerializer>,
77  std::pair<ARssSensor *, s11n::NoopSerializer>,
78  std::pair<ASceneCaptureCamera *, s11n::ImageSerializer>,
79  std::pair<ASemanticSegmentationCamera *, s11n::ImageSerializer>,
80  std::pair<AInstanceSegmentationCamera *, s11n::ImageSerializer>,
81  std::pair<FWorldObserver *, s11n::EpisodeStateSerializer>,
82  std::pair<FCameraGBufferUint8 *, s11n::GBufferUint8Serializer>,
83  std::pair<FCameraGBufferFloat *, s11n::GBufferFloatSerializer>
84  >;
85 
86 } // namespace sensor
87 } // namespace carla
88 
89 #endif // LIBCARLA_SENSOR_REGISTRY_INCLUDE_H
90 
91 #ifdef LIBCARLA_SENSOR_REGISTRY_WITH_SENSOR_INCLUDES
92 
93 // 4. Include the sensor here.
97 #include "Carla/Sensor/DVSCamera.h"
103 #include "Carla/Sensor/Radar.h"
106 #include "Carla/Sensor/RssSensor.h"
111 
112 #endif // LIBCARLA_SENSOR_REGISTRY_WITH_SENSOR_INCLUDES
CompositeSerializer< std::pair< ACollisionSensor *, s11n::CollisionEventSerializer >, std::pair< ADepthCamera *, s11n::ImageSerializer >, std::pair< ANormalsCamera *, s11n::NormalsImageSerializer >, std::pair< ADVSCamera *, s11n::DVSEventArraySerializer >, std::pair< AGnssSensor *, s11n::GnssSerializer >, std::pair< AInertialMeasurementUnit *, s11n::IMUSerializer >, std::pair< ALaneInvasionSensor *, s11n::NoopSerializer >, std::pair< AObstacleDetectionSensor *, s11n::ObstacleDetectionEventSerializer >, std::pair< AOpticalFlowCamera *, s11n::OpticalFlowImageSerializer >, std::pair< ARadar *, s11n::RadarSerializer >, std::pair< ARayCastSemanticLidar *, s11n::SemanticLidarSerializer >, std::pair< ARayCastLidar *, s11n::LidarSerializer >, std::pair< ARssSensor *, s11n::NoopSerializer >, std::pair< ASceneCaptureCamera *, s11n::ImageSerializer >, std::pair< ASemanticSegmentationCamera *, s11n::ImageSerializer >, std::pair< AInstanceSegmentationCamera *, s11n::ImageSerializer >, std::pair< FWorldObserver *, s11n::EpisodeStateSerializer >, std::pair< FCameraGBufferUint8 *, s11n::GBufferUint8Serializer >, std::pair< FCameraGBufferFloat *, s11n::GBufferFloatSerializer > > SensorRegistry
Contains a registry of all the sensors available and allows serializing and deserializing sensor data...
LaneInvasion sensor representation The actual position calculation is done one client side...
Serializes and sends all the actors in the current UCarlaEpisode.
Definition: WorldObserver.h:14
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
A sensor to register collisions.
A ray-cast based Radar sensor.
Definition: Radar.h:21
A ray-cast based Lidar sensor.
Definition: RayCastLidar.h:24
A sensor that captures images from the scene.
RSS sensor representation The actual calculation is done one client side.
A ray-cast based Lidar sensor.
Gnss sensor representation The actual position calculation is done one server side.
Definition: GnssSensor.h:23
A sensor to register collisions.
Sensor that produces "depth" images.
Definition: DepthCamera.h:17
Sensor that produces "normals" images.
Definition: NormalsCamera.h:17
Sensor that produce Dynamic Vision Events.
Definition: DVSCamera.h:43
Sensor that produces "Instance segmentation" images.
Sensor that produces "semantic segmentation" images.
Sensor that produces "optical flow" images.