CARLA
SensorRegistry.h
Go to the documentation of this file.
1 // Copyright (c) 2019 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.
28 
29 // 2. Add a forward-declaration of the sensor here.
30 class ACollisionSensor;
31 class ADepthCamera;
32 class ADVSCamera;
33 class AGnssSensor;
37 class ARadar;
39 class ARayCastLidar;
42 class ARssSensor;
43 class FWorldObserver;
44 
45 namespace carla {
46 namespace sensor {
47 
48  // 3. Register the sensor and its serializer in the SensorRegistry.
49 
50  /// Contains a registry of all the sensors available and allows serializing
51  /// and deserializing sensor data for the types registered.
52  ///
53  /// Use s11n::NoopSerializer if the sensor does not send data (sensors that
54  /// work only on client-side).
55  using SensorRegistry = CompositeSerializer<
56  std::pair<ACollisionSensor *, s11n::CollisionEventSerializer>,
57  std::pair<ADepthCamera *, s11n::ImageSerializer>,
58  std::pair<ADVSCamera *, s11n::DVSEventArraySerializer>,
59  std::pair<AGnssSensor *, s11n::GnssSerializer>,
60  std::pair<AInertialMeasurementUnit *, s11n::IMUSerializer>,
61  std::pair<ALaneInvasionSensor *, s11n::NoopSerializer>,
62  std::pair<AObstacleDetectionSensor *, s11n::ObstacleDetectionEventSerializer>,
63  std::pair<ARadar *, s11n::RadarSerializer>,
64  std::pair<ARayCastSemanticLidar *, s11n::SemanticLidarSerializer>,
65  std::pair<ARayCastLidar *, s11n::LidarSerializer>,
66  std::pair<ARssSensor *, s11n::NoopSerializer>,
67  std::pair<ASceneCaptureCamera *, s11n::ImageSerializer>,
68  std::pair<ASemanticSegmentationCamera *, s11n::ImageSerializer>,
69  std::pair<FWorldObserver *, s11n::EpisodeStateSerializer>
70  >;
71 
72 } // namespace sensor
73 } // namespace carla
74 
75 #endif // LIBCARLA_SENSOR_REGISTRY_INCLUDE_H
76 
77 #ifdef LIBCARLA_SENSOR_REGISTRY_WITH_SENSOR_INCLUDES
78 
79 // 4. Include the sensor here.
82 #include "Carla/Sensor/DVSCamera.h"
87 #include "Carla/Sensor/Radar.h"
90 #include "Carla/Sensor/RssSensor.h"
94 
95 #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:99
A sensor to register collisions.
A ray-cast based Radar sensor.
Definition: Radar.h:21
CompositeSerializer< std::pair< ACollisionSensor *, s11n::CollisionEventSerializer >, std::pair< ADepthCamera *, 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< 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< 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.
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 produce Dynamic Vision Events.
Definition: DVSCamera.h:42
Sensor that produces "semantic segmentation" images.