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.
29 
30 // 2. Add a forward-declaration of the sensor here.
31 class ACollisionSensor;
32 class ADepthCamera;
33 class ANormalsCamera;
34 class ADVSCamera;
35 class AGnssSensor;
39 class AOpticalFlowCamera;
40 class ARadar;
42 class ARayCastLidar;
46 class ARssSensor;
47 class FWorldObserver;
48 
49 namespace carla {
50 namespace sensor {
51 
52  // 3. Register the sensor and its serializer in the SensorRegistry.
53 
54  /// Contains a registry of all the sensors available and allows serializing
55  /// and deserializing sensor data for the types registered.
56  ///
57  /// Use s11n::NoopSerializer if the sensor does not send data (sensors that
58  /// work only on client-side).
59  using SensorRegistry = CompositeSerializer<
60  std::pair<ACollisionSensor *, s11n::CollisionEventSerializer>,
61  std::pair<ADepthCamera *, s11n::ImageSerializer>,
62  std::pair<ANormalsCamera *, s11n::ImageSerializer>,
63  std::pair<ADVSCamera *, s11n::DVSEventArraySerializer>,
64  std::pair<AGnssSensor *, s11n::GnssSerializer>,
65  std::pair<AInertialMeasurementUnit *, s11n::IMUSerializer>,
66  std::pair<ALaneInvasionSensor *, s11n::NoopSerializer>,
67  std::pair<AObstacleDetectionSensor *, s11n::ObstacleDetectionEventSerializer>,
68  std::pair<AOpticalFlowCamera *, s11n::OpticalFlowImageSerializer>,
69  std::pair<ARadar *, s11n::RadarSerializer>,
70  std::pair<ARayCastSemanticLidar *, s11n::SemanticLidarSerializer>,
71  std::pair<ARayCastLidar *, s11n::LidarSerializer>,
72  std::pair<ARssSensor *, s11n::NoopSerializer>,
73  std::pair<ASceneCaptureCamera *, s11n::ImageSerializer>,
74  std::pair<ASemanticSegmentationCamera *, s11n::ImageSerializer>,
75  std::pair<AInstanceSegmentationCamera *, s11n::ImageSerializer>,
76  std::pair<FWorldObserver *, s11n::EpisodeStateSerializer>
77  >;
78 
79 } // namespace sensor
80 } // namespace carla
81 
82 #endif // LIBCARLA_SENSOR_REGISTRY_INCLUDE_H
83 
84 #ifdef LIBCARLA_SENSOR_REGISTRY_WITH_SENSOR_INCLUDES
85 
86 // 4. Include the sensor here.
90 #include "Carla/Sensor/DVSCamera.h"
96 #include "Carla/Sensor/Radar.h"
99 #include "Carla/Sensor/RssSensor.h"
104 
105 #endif // LIBCARLA_SENSOR_REGISTRY_WITH_SENSOR_INCLUDES
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.
CompositeSerializer< std::pair< ACollisionSensor *, s11n::CollisionEventSerializer >, std::pair< ADepthCamera *, s11n::ImageSerializer >, std::pair< ANormalsCamera *, s11n::ImageSerializer >, 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 > > SensorRegistry
Contains a registry of all the sensors available and allows serializing and deserializing sensor data...
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:42
Sensor that produces "Instance segmentation" images.
Sensor that produces "semantic segmentation" images.
Sensor that produces "optical flow" images.