2019-05-03 18:18:02 +08:00
---
- module_name : carla
2019-05-03 20:56:18 +08:00
# - CLASSES ------------------------------
2019-05-03 18:18:02 +08:00
classes :
2019-05-03 20:56:18 +08:00
- class_name : SensorData
2019-05-03 18:18:02 +08:00
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Base class for all the objects containing data generated by a carla.Sensor. This objects should be the argument of the function said sensor is listening to, in order to work with them. Each of these sensors needs for a specific type of sensor data. The relation between available sensors and their corresponding data goes like :
- Cameras (RGB, depth and semantic segmentation) : carla.Image.
- Collision detector : carla.CollisionEvent.
- Gnss detector : carla.GnssMeasurement.
- IMU detector : carla.IMUMeasurement.
- Lane invasion detector : carla.LaneInvasionEvent.
- Lidar raycast : carla.LidarMeasurement.
- Obstacle detector : carla.ObstacleDetectionEvent.
- Radar detector : carla.RadarMeasurement.
2019-05-03 18:18:02 +08:00
# - PROPERTIES -------------------------
instance_variables :
2019-07-02 19:10:28 +08:00
- var_name : frame
2019-07-04 17:12:14 +08:00
type : int
2019-05-03 20:56:18 +08:00
doc : >
2019-07-02 19:10:28 +08:00
Frame count when the data was generated.
2019-05-03 20:56:18 +08:00
- var_name : timestamp
2019-07-04 17:12:14 +08:00
type : float
2019-05-03 20:56:18 +08:00
doc : >
2019-07-02 19:10:28 +08:00
Simulation-time when the data was generated.
2019-05-03 20:56:18 +08:00
- var_name : transform
2019-07-04 17:12:14 +08:00
type : carla.Transform
2019-05-03 20:56:18 +08:00
doc : >
2019-07-02 19:10:28 +08:00
Sensor's transform when the data was generated.
2019-07-03 00:32:23 +08:00
# --------------------------------------
2019-05-03 20:56:18 +08:00
- class_name : ColorConverter
# - DESCRIPTION ------------------------
doc : >
2020-03-02 21:35:50 +08:00
Class that defines conversion patterns that can be applied to a carla.Image in order to show information provided by carla.Sensor. Depth conversions cause a loss of accuracy, as sensors detect depth as <b>float</b> that is then converted to a grayscale value between 0 and 255. Take a look a this [recipe](ref_code_recipes.md#converted-image-recipe) to see an example of how to create and save image data for <b>sensor.camera.semantic_segmentation</b>.
2019-05-03 20:56:18 +08:00
# - PROPERTIES -------------------------
instance_variables :
2020-02-24 20:58:54 +08:00
- var_name : CityScapesPalette
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Converts the image to a segmentated map using tags provided by the blueprint library. Used by <b>sensor.camera.semantic_segmentation</b>.
2019-05-03 20:56:18 +08:00
- var_name : Depth
doc : >
2020-02-24 20:58:54 +08:00
Converts the image to a linear depth map. Used by <b>sensor.camera.depth</b>.
2019-05-03 20:56:18 +08:00
- var_name : LogarithmicDepth
doc : >
2020-02-24 20:58:54 +08:00
Converts the image to a depth map using a logarithmic scale, leading to better precision for small distances at the expense of losing it when further away.
- var_name : Raw
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
No changes applied to the image.
2019-05-03 20:56:18 +08:00
- class_name : Image
2019-06-05 21:05:57 +08:00
parent : carla.SensorData
2019-05-03 20:56:18 +08:00
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines an image of 32-bit BGRA colors that will be used as initial data retrieved by camera sensors. There are different camera sensors (currently three, RGB, depth and semantic segmentation) and each of these makes different use for the images. Learn more about them [here](/cameras_and_sensors/).
2019-05-03 20:56:18 +08:00
# - PROPERTIES -------------------------
instance_variables :
2020-02-24 20:58:54 +08:00
- var_name : fov
type : float
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Horizontal field of view of the image in degrees.
2019-05-03 20:56:18 +08:00
- var_name : height
2019-07-03 22:18:21 +08:00
type : int
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Image height in pixels.
- var_name : width
type : int
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Image width in pixels.
2019-05-03 20:56:18 +08:00
- var_name : raw_data
2019-07-03 22:18:21 +08:00
type : bytes
2019-05-03 20:56:18 +08:00
# - METHODS ----------------------------
methods :
- def_name : convert
2019-07-02 19:10:28 +08:00
params :
- param_name : color_converter
type : carla.ColorConverter
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Converts the image following the `color_converter` pattern.
2019-05-03 20:56:18 +08:00
# --------------------------------------
- def_name : save_to_disk
2019-07-02 19:10:28 +08:00
params :
- param_name : path
type : str
2019-08-03 02:15:14 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Path that will contain the image.
2019-07-02 19:10:28 +08:00
- param_name : color_converter
type : carla.ColorConverter
default : Raw
2020-02-24 20:58:54 +08:00
doc : >
Default <b>Raw</b> will make no changes.
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Saves the image to disk using a converter pattern stated as `color_converter`. The default conversion pattern is <b>Raw</b> that will make no changes to the image.
2019-05-03 20:56:18 +08:00
# --------------------------------------
- def_name : __len__
# --------------------------------------
- def_name : __iter__
# --------------------------------------
- def_name : __getitem__
2019-07-02 19:10:28 +08:00
params :
- param_name : pos
2019-07-03 22:18:21 +08:00
type : int
2019-05-03 20:56:18 +08:00
# --------------------------------------
- def_name : __setitem__
2019-07-02 19:10:28 +08:00
params :
- param_name : pos
2019-07-03 22:18:21 +08:00
type : int
2019-07-02 19:10:28 +08:00
- param_name : color
type : carla.Color
# --------------------------------------
- def_name : __str__
2019-05-03 20:56:18 +08:00
# --------------------------------------
- class_name : LidarMeasurement
2019-06-05 21:05:57 +08:00
parent : carla.SensorData
2019-05-03 20:56:18 +08:00
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines the lidar data retrieved by a <b>sensor.lidar.ray_cast</b>. This essentially simulates a rotating lidar using ray-casting. Learn more about this [here](/cameras_and_sensors/#sensorlidarray_cast).
2019-05-03 20:56:18 +08:00
# - PROPERTIES -------------------------
instance_variables :
- var_name : channels
2019-07-03 22:18:21 +08:00
type : int
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Number of lasers shot.
- var_name : horizontal_angle
type : float
doc : >
Horizontal angle the Lidar is rotated at the time of the measurement (in radians).
2019-05-03 20:56:18 +08:00
- var_name : raw_data
2019-07-03 22:18:21 +08:00
type : bytes
2019-05-03 18:18:02 +08:00
doc : >
2020-02-24 20:58:54 +08:00
List of 3D points received as data.
2019-05-03 18:18:02 +08:00
# - METHODS ----------------------------
methods :
2019-05-03 20:56:18 +08:00
- def_name : get_point_count
2019-07-02 19:10:28 +08:00
params :
2019-11-14 01:50:21 +08:00
- param_name : channel
2019-07-03 22:18:21 +08:00
type : int
2019-05-03 18:18:02 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Retrieves the number of points sorted by channel that are generated by this measure. Sorting by channel allows to identify the original channel for every point.
2019-05-03 18:18:02 +08:00
# --------------------------------------
2019-05-03 20:56:18 +08:00
- def_name : save_to_disk
2019-07-02 19:10:28 +08:00
params :
2019-11-14 01:50:21 +08:00
- param_name : path
2019-07-02 19:10:28 +08:00
type : str
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Saves the point cloud to disk as a <b>.ply</b> file describing data from 3D scanners. The files generated are ready to be used within [MeshLab](http://www.meshlab.net/), an open source system for processing said files. Just take into account that axis may differ from Unreal Engine and so, need to be reallocated.
2019-05-03 20:56:18 +08:00
# --------------------------------------
- def_name : __len__
# --------------------------------------
- def_name : __iter__
# --------------------------------------
- def_name : __getitem__
2019-07-02 19:10:28 +08:00
params :
- param_name : pos
2019-07-03 22:18:21 +08:00
type : int
2019-05-03 20:56:18 +08:00
# --------------------------------------
- def_name : __setitem__
2019-07-02 19:10:28 +08:00
params :
- param_name : pos
2019-07-03 22:18:21 +08:00
type : int
2019-07-02 19:10:28 +08:00
- param_name : location
type : carla.Location
# --------------------------------------
- def_name : __str__
2019-05-03 20:56:18 +08:00
# --------------------------------------
- class_name : CollisionEvent
2019-06-05 21:05:57 +08:00
parent : carla.SensorData
2019-05-03 20:56:18 +08:00
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines a collision data for <b>sensor.other.collision</b>. The sensor creates one of this for every collision detected which may be many for one simulation step. Learn more about this [here](/cameras_and_sensors/#sensorothercollision).
2019-05-03 20:56:18 +08:00
# - PROPERTIES -------------------------
instance_variables :
- var_name : actor
2019-07-02 19:10:28 +08:00
type : carla.Actor
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
The actor the sensor is attached to, the one that measured the collision.
2019-05-03 20:56:18 +08:00
- var_name : other_actor
2019-07-02 19:10:28 +08:00
type : carla.Actor
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
The second actor involved in the collision.
2019-05-03 20:56:18 +08:00
- var_name : normal_impulse
2019-07-02 19:10:28 +08:00
type : carla.Vector3D
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Normal impulse resulting of the collision.
2019-05-03 20:56:18 +08:00
- class_name : ObstacleDetectionEvent
2019-06-05 21:05:57 +08:00
parent : carla.SensorData
2019-05-03 20:56:18 +08:00
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines the obstacle data for <b>sensor.other.obstacle</b>. Learn more about this [here](/cameras_and_sensors/#sensorotherobstacle).
2019-05-03 20:56:18 +08:00
# - PROPERTIES -------------------------
instance_variables :
- var_name : actor
2019-07-02 19:10:28 +08:00
type : carla.Actor
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
The actor the sensor is attached to.
2019-05-03 20:56:18 +08:00
- var_name : other_actor
2019-07-02 19:10:28 +08:00
type : carla.Actor
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
The actor or object considered to be an obstacle.
2019-05-03 20:56:18 +08:00
- var_name : distance
2019-07-02 19:10:28 +08:00
type : float
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Distance between `actor` and `other`.
2019-07-03 00:32:23 +08:00
# - METHODS ----------------------------
methods :
- def_name : __str__
2019-07-02 19:10:28 +08:00
# --------------------------------------
2019-05-03 20:56:18 +08:00
- class_name : LaneInvasionEvent
2019-06-05 21:05:57 +08:00
parent : carla.SensorData
2019-05-03 20:56:18 +08:00
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines lanes invasion for <b>sensor.other.lane_invasion</b>. It works only client-side and is dependant on OpenDRIVE to provide reliable information. The sensor creates one of this every time there is a lane invasion, which may be more than once per simulation step. Learn more about this [here](/cameras_and_sensors/#sensorotherlane_invasion).
2019-05-03 20:56:18 +08:00
# - PROPERTIES -------------------------
instance_variables :
- var_name : actor
2019-07-02 19:10:28 +08:00
type : carla.Actor
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
Gets the actor the sensor is attached to, the one that invaded another lane.
2019-05-03 20:56:18 +08:00
- var_name : crossed_lane_markings
2019-07-02 19:10:28 +08:00
type : list(carla.LaneMarking)
2019-05-03 20:56:18 +08:00
doc : >
2020-02-24 20:58:54 +08:00
List of lane markings that have been crossed and detected by the sensor.
2019-07-03 00:32:23 +08:00
# - METHODS ----------------------------
methods :
- def_name : __str__
2019-07-02 19:10:28 +08:00
# --------------------------------------
2019-05-03 20:56:18 +08:00
2019-11-14 01:50:21 +08:00
- class_name : GnssMeasurement
2019-06-05 21:05:57 +08:00
parent : carla.SensorData
2019-05-03 20:56:18 +08:00
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines the Gnss data registered by a <b>sensor.other.gnss</b>. It essentially reports its position with the position of the sensor and an OpenDRIVE geo-reference.
2019-05-03 20:56:18 +08:00
# - PROPERTIES -------------------------
instance_variables :
2020-02-24 20:58:54 +08:00
- var_name : altitude
type : float
doc : >
Height regarding ground level.
2019-05-03 20:56:18 +08:00
- var_name : latitude
2019-07-02 19:10:28 +08:00
type : float
2019-05-03 20:56:18 +08:00
doc : >
2019-11-14 01:50:21 +08:00
North/South value of a point on the map.
2019-05-03 20:56:18 +08:00
- var_name : longitude
2019-07-02 19:10:28 +08:00
type : float
2019-05-03 20:56:18 +08:00
doc : >
2019-11-14 01:50:21 +08:00
West/East value of a point on the map.
2019-07-03 00:32:23 +08:00
# - METHODS ----------------------------
methods :
- def_name : __str__
2019-11-14 01:50:21 +08:00
# --------------------------------------
- class_name : IMUMeasurement
parent : carla.SensorData
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines the data registered by a <b>sensor.other.imu</b>, regarding the sensor's transformation according to the current carla.World. It essentially acts as accelerometer, gyroscope and compass.
2019-11-14 01:50:21 +08:00
# - PROPERTIES -------------------------
instance_variables :
- var_name : accelerometer
type : carla.Vector3D
doc : >
2020-02-24 20:58:54 +08:00
Linear acceleration in m/s^2.
2019-11-14 01:50:21 +08:00
- var_name : compass
type : float
doc : >
2020-02-24 20:58:54 +08:00
Orientation with regard to the North ((0.0, -1.0, 0.0) in Unreal Engine) in radians.
- var_name : gyroscope
type : carla.Vector3D
doc : >
Angular velocity in rad/sec.
2019-11-14 01:50:21 +08:00
# - METHODS ----------------------------
methods :
- def_name : __str__
2019-07-03 00:32:23 +08:00
# --------------------------------------
2019-12-09 22:54:53 +08:00
- class_name : RadarMeasurement
parent : carla.SensorData
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Class that defines and gathers the measures registered by a <b>sensor.other.radar</b>, representing a wall of points in front of the sensor with a distance, angle and velocity in relation to it. The data consists of a carla.RadarDetection array.
2019-12-09 22:54:53 +08:00
# - PROPERTIES -------------------------
instance_variables :
- var_name : raw_data
type : bytes
doc : >
2020-02-24 20:58:54 +08:00
The complete information of the carla.RadarDetection the radar has registered.
2019-12-09 22:54:53 +08:00
# - METHODS ----------------------------
methods :
- def_name : get_detection_count
doc : >
2020-02-24 20:58:54 +08:00
Retrieves the number of entries generated, same as **<font color="#7fb800">\__str__()</font>**.
2019-12-09 22:54:53 +08:00
# --------------------------------------
- def_name : __len__
# --------------------------------------
- def_name : __iter__
# --------------------------------------
- def_name : __getitem__
params :
- param_name : pos
type : int
# --------------------------------------
- def_name : __setitem__
params :
- param_name : pos
type : int
- param_name : detection
type : carla.RadarDetection
# --------------------------------------
- def_name : __str__
# --------------------------------------
- class_name : RadarDetection
# - DESCRIPTION ------------------------
doc : >
2020-02-24 20:58:54 +08:00
Data contained inside a carla.RadarMeasurement. Each of these represents one of the points in the cloud that a <b>sensor.other.radar</b> registers and contains the distance, angle and velocity in relation to the radar.
2019-12-09 22:54:53 +08:00
# - PROPERTIES -------------------------
instance_variables :
2020-02-24 20:58:54 +08:00
- var_name : altitude
2019-12-09 22:54:53 +08:00
type : float
doc : >
2020-02-24 20:58:54 +08:00
Altitude angle of the detection in radians.
2019-12-09 22:54:53 +08:00
# --------------------------------------
- var_name : azimuth
type : float
doc : >
2020-02-24 20:58:54 +08:00
Azimuth angle of the detection in radians.
2019-12-09 22:54:53 +08:00
# --------------------------------------
2020-02-24 20:58:54 +08:00
- var_name : depth
2019-12-09 22:54:53 +08:00
type : float
doc : >
2020-02-24 20:58:54 +08:00
Distance in meters from the sensor to the detection position.
2019-12-09 22:54:53 +08:00
# --------------------------------------
2020-02-24 20:58:54 +08:00
- var_name : velocity
2019-12-09 22:54:53 +08:00
type : float
doc : >
2020-02-24 20:58:54 +08:00
The velocity of the detected object towards the sensor in m/s.
2019-12-09 22:54:53 +08:00
# - METHODS ----------------------------
methods :
- def_name : __str__
# --------------------------------------
2019-05-03 18:18:02 +08:00
...