diff --git a/Docs/python_api.md b/Docs/python_api.md index e0e0aa72a..a7ab163a2 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -421,19 +421,16 @@ Parses the location and extent of the bounding box to string. ## carla.CAMData Inherited from _[carla.SensorData](#carla.SensorData)_
-This is the data type for cooperative awareness message reception, contained in a [CAMEvent](#carlacamevent) +This is the data type for cooperative awareness message reception, contained in a [CAMEvent](#carlacamevent). + ### Instance Variables -- **power** (_float - dBm_) +- **power** (_float - dBm_) Received power. ### Methods -- **get**(**self**) -Get the CAM data. - - **Return:** _dict_ - - Returns a nested dictionary containing the message following the ETSI standard: - - `"Header"`: _dict_ - - `"Message"`: _dict_ +- **get**(**self**) +Get the CAM data. Returns a nested dictionary containing the message following the ETSI standard: - `Header`: dict - `Message`: dict. + - **Return:** _dict_ ##### Dunder methods - **\__str__**(**self**) @@ -442,25 +439,23 @@ Get the CAM data. ## carla.CAMEvent Inherited from _[carla.SensorData](#carla.SensorData)_
-Class that defines the data provided by a sensor.other.v2x. This is a collection type to combine returning several [CAMData](#carlacamdata). - -### Instance Variables - +Class that defines the data provided by a **sensor.other.v2x**. This is a collection type to combine returning several [CAMData](#carlacamdata). ### Methods -- **get_message_count**(**self**) -Get the number of received CAM's. - - **Return:** _int_ + +##### Getters +- **get_message_count**(**self**) +Get the number of received CAM's. + - **Return:** _int_ ##### Dunder methods -- **\__getitem__**(**self**, **pos**=int) +- **\__get_item__**(**self**, **pos**=int) - **\__iter__**(**self**) -Iterate over the [carla.CAMData](#carla.CAMData) retrieved as data. -- **\__len__**(**self**) +Iterate over the [CAMData](#carlacamdata) retrieved as data. +- **\__len__**(**self**) --- - ## carla.CityObjectLabel Enum declaration that contains the different tags available to filter the bounding boxes returned by [carla.World.get_level_bbs](#carla.World.get_level_bbs)(). These values correspond to the [semantic tag](ref_sensors.md#semantic-segmentation-camera) that the elements in the scene have. @@ -618,8 +613,8 @@ Returns the client libcarla version by consulting it in the "Version.h" file. Bo - **get_required_files**(**self**, **folder**, **download**=True) Asks the server which files are required by the client to use the current map. Option to download files automatically if they are not already in the cache. - **Parameters:** - - `folder` (_str_) - Folder where files required by the client will be downloaded to. - - `download` (_bool_) - If True, downloads files that are not already in cache. + - `folder` (_str_) - Specifies a folder to look through on the server maps. Leaving this blank will search recursively through all map folders in the server, which is recommended if you're unfamiliar with the server map folder structure. + - `download` (_bool_) - If True, downloads files that are not already in cache. The cache can be found at "HOME\carlaCache" or "USERPROFILE\carlaCache", depending on OS. - **get_server_version**(**self**) Returns the server libcarla version by consulting it in the "Version.h" file. Both client and server should use the same libcarla version. - **Return:** _str_ @@ -710,23 +705,19 @@ Converts the image to a depth map using a logarithmic scale, leading to better p No changes applied to the image. Used by the [RGB camera](ref_sensors.md#rgb-camera). --- + ## carla.CustomV2XData Inherited from _[carla.SensorData](#carla.SensorData)_
-This is the data type defining a custom V2X message. Received as part of a [CustomV2XEvent](#carla.CustomV2XEvent). +This is the data type defining a custom V2X message. Received as part of a [CustomV2XEvent](#carlacustomv2xevent). ### Instance Variables -- **power** (_float - dBm_) +- **power** (_float - dBm_) Received power. ### Methods -- **get**(**self**) -Get the custom message. - - **Return:** _dict_. - - Returns a nested dictionary containing the message. It has two primary keys: - - `"Header"` : _dict_ - - `"Message"`: _str_ - +- **get**(**self**) +Get the custom message. Returns a nested dictionary containing the message. It has two primary keys: - `Header` : dict - `Message`: str. + - **Return:** _dict_ ##### Dunder methods - **\__str__**(**self**) @@ -735,25 +726,23 @@ Get the custom message. ## carla.CustomV2XEvent Inherited from _[carla.SensorData](#carla.SensorData)_
-Class that defines the data provided by a sensor.other.v2x_custom. This is a collection type to combine returning several [CustomV2XData](#carla.CustomV2XData). - -### Instance Variables - +Class that defines the data provided by a **sensor.other.v2x_custom**. This is a collection type to combine returning several [CustomV2XData](#carlacustomv2xdata). ### Methods -- **get_message_count**(**self**) -Get the number of received CAM's. - - **Return:** _int_ + +##### Getters +- **get_message_count**(**self**) +Get the number of received CAM's. + - **Return:** _int_ ##### Dunder methods -- **\__getitem__**(**self**, **pos**=int) +- **\__get_item__**(**self**, **pos**=int) - **\__iter__**(**self**) -Iterate over the [carla.CustomV2XData](#carla.CustomV2XData) retrieved as data. +Iterate over the [CustomV2XData](#carlacustomv2xdata) retrieved as data. - **\__len__**(**self**) --- - ## carla.DVSEvent Class that defines a DVS event. An event is a quadruple, so a tuple of 4 elements, with `x`, `y` pixel coordinate location, timestamp `t` and polarity `pol` of the event. Learn more about them [here](ref_sensors.md). @@ -942,7 +931,7 @@ Initializes a color, black by default. --- ## carla.GBufferTextureID -Defines the identifiers of each GBuffer texture (See the method `[carla.Sensor.listen_to_gbuffer](#carla.Sensor.listen_to_gbuffer)`). +Defines the of each GBuffer texture (See the method `[carla.Sensor.listen_to_gbuffer](#carla.Sensor.listen_to_gbuffer)`). ### Instance Variables - **SceneColor** @@ -2315,26 +2304,26 @@ Iterate over the [carla.SemanticLidarDetection](#carla.SemanticLidarDetection) r Inherited from _[carla.Actor](#carla.Actor)_
Sensors compound a specific family of actors quite diverse and unique. They are normally spawned as attachment/sons of a vehicle (take a look at [carla.World](#carla.World) to learn about actor spawning). Sensors are thoroughly designed to retrieve different types of data that they are listening to. The data they receive is shaped as different subclasses inherited from [carla.SensorData](#carla.SensorData) (depending on the sensor). - Most sensors can be divided in two groups: those receiving data on every tick (cameras, point clouds and some specific sensors) and those who only receive under certain circumstances (trigger detectors). CARLA provides a specific set of sensors and their blueprint can be found in [carla.BlueprintLibrary](#carla.BlueprintLibrary). All the information on their preferences and settlement can be found [here](ref_sensors.md), but the list of those available in CARLA so far goes as follow. -
Receive data on every tick. - - [Depth camera](ref_sensors.md#depth-camera). - - [Gnss sensor](ref_sensors.md#gnss-sensor). - - [IMU sensor](ref_sensors.md#imu-sensor). - - [Lidar raycast](ref_sensors.md#lidar-raycast-sensor). - - [SemanticLidar raycast](ref_sensors.md#semanticlidar-raycast-sensor). - - [Radar](ref_sensors.md#radar-sensor). - - [RGB camera](ref_sensors.md#rgb-camera). - - [RSS sensor](ref_sensors.md#rss-sensor). - - [Semantic Segmentation camera](ref_sensors.md#semantic-segmentation-camera). -
Only receive data when triggered. - - [Collision detector](ref_sensors.md#collision-detector). - - [Lane invasion detector](ref_sensors.md#lane-invasion-detector). - - [Obstacle detector](ref_sensors.md#obstacle-detector). + Most sensors can be divided in two groups: those receiving data on every tick (cameras, point clouds and some specific sensors) and those who only receive under certain circumstances (trigger detectors). CARLA provides a specific set of sensors and their blueprint can be found in [carla.BlueprintLibrary](#carla.BlueprintLibrary). All the information on their preferences and settlement can be found [here](ref_sensors.md), but the list of those available in CARLA so far goes as follows:
+
Receive data on every tick
+ - [Depth camera](ref_sensors.md#depth-camera)
+ - [Gnss sensor](ref_sensors.md#gnss-sensor)
+ - [IMU sensor](ref_sensors.md#imu-sensor)
+ - [Lidar raycast](ref_sensors.md#lidar-raycast-sensor)
+ - [SemanticLidar raycast](ref_sensors.md#semanticlidar-raycast-sensor)
+ - [Radar](ref_sensors.md#radar-sensor)
+ - [RGB camera](ref_sensors.md#rgb-camera)
+ - [RSS sensor](ref_sensors.md#rss-sensor)
+ - [Semantic Segmentation camera](ref_sensors.md#semantic-segmentation-camera)
+
Only receive data when triggered.
+ - [Collision detector](ref_sensors.md#collision-detector)
+ - [Lane invasion detector](ref_sensors.md#lane-invasion-detector)
+ - [Obstacle detector](ref_sensors.md#obstacle-detector)
- [V2X sensor](ref_sensors.md#v2x-sensor). ### Instance Variables - **is_listening** (_boolean_) -When True the sensor will be waiting for data. +When **True** the sensor will be waiting for data. ### Methods - **disable_for_ros**(**self**) @@ -2343,12 +2332,15 @@ Commands the sensor to not be processed for publishing in ROS2 if there is no an Commands the sensor to be processed to be able to publish in ROS2 without any listen to it. - **is_enabled_for_ros**(**self**) Returns if the sensor is enabled or not to publish in ROS2 if there is no any listen to it. + - **Return:** _bool_ - **is_listening**(**self**) Returns whether the sensor is in a listening state. + - **Return:** _bool_ - **is_listening_gbuffer**(**self**, **gbuffer_id**) Returns whether the sensor is in a listening state for a specific GBuffer texture. - **Parameters:** - `gbuffer_id` (_[carla.GBufferTextureID](#carla.GBufferTextureID)_) - The ID of the target Unreal Engine GBuffer texture. + - **Return:** _bool_ - **listen**(**self**, **callback**) The function the sensor will be calling to every time a new measurement is received. This function needs for an argument containing an object type [carla.SensorData](#carla.SensorData) to work with. - **Parameters:** @@ -2361,7 +2353,7 @@ The function the sensor will be calling to every time the desired GBuffer textur - **send**(**self**, **message**) Instructs the sensor to send the string given by `message` to all other CustomV2XSensors on the next tick. - **Parameters:** - - `message` (_string_) - The data to send. *Note*: maximum string length is 100 chars. + - `message` (_string_) - The data to send. Note: maximum string length is 100 chars. - **stop**(**self**) Commands the sensor to stop listening for data. - **stop_gbuffer**(**self**, **gbuffer_id**) @@ -2385,8 +2377,8 @@ Base class for all the objects containing data generated by a [carla.Sensor](#ca - Obstacle detector: [carla.ObstacleDetectionEvent](#carla.ObstacleDetectionEvent).
- Radar sensor: [carla.RadarMeasurement](#carla.RadarMeasurement).
- RSS sensor: [carla.RssResponse](#carla.RssResponse).
- - Semantic LIDAR sensor: [carla.SemanticLidarMeasurement](#carla.SemanticLidarMeasurement). - - Cooperative awareness messages V2X sensor: [carla.CAMEvent](#carla.CAMEvent). + - Semantic LIDAR sensor: [carla.SemanticLidarMeasurement](#carla.SemanticLidarMeasurement).
+ - Cooperative awareness messages V2X sensor: [carla.CAMEvent](#carla.CAMEvent).
- Custom V2X messages V2X sensor: [carla.CustomV2XEvent](#carla.CustomV2XEvent). ### Instance Variables diff --git a/PythonAPI/docs/client.yml b/PythonAPI/docs/client.yml index 3f4e40388..2977c9337 100644 --- a/PythonAPI/docs/client.yml +++ b/PythonAPI/docs/client.yml @@ -352,12 +352,12 @@ - param_name: folder type: str doc: > - Folder where files required by the client will be downloaded to. + Specifies a folder to look through on the server maps. Leaving this blank will search recursively through all map folders in the server, which is recommended if you're unfamiliar with the server map folder structure. - param_name: download type: bool default: True doc: > - If True, downloads files that are not already in cache. + If True, downloads files that are not already in cache. The cache can be found at "HOME\carlaCache" or "USERPROFILE\carlaCache", depending on OS. doc: > Asks the server which files are required by the client to use the current map. Option to download files automatically if they are not already in the cache. # -------------------------------------- diff --git a/PythonAPI/docs/sensor.yml b/PythonAPI/docs/sensor.yml index 06e78c2a5..5885217cd 100644 --- a/PythonAPI/docs/sensor.yml +++ b/PythonAPI/docs/sensor.yml @@ -8,21 +8,28 @@ doc: > Sensors compound a specific family of actors quite diverse and unique. They are normally spawned as attachment/sons of a vehicle (take a look at carla.World to learn about actor spawning). Sensors are thoroughly designed to retrieve different types of data that they are listening to. The data they receive is shaped as different subclasses inherited from carla.SensorData (depending on the sensor). - Most sensors can be divided in two groups: those receiving data on every tick (cameras, point clouds and some specific sensors) and those who only receive under certain circumstances (trigger detectors). CARLA provides a specific set of sensors and their blueprint can be found in carla.BlueprintLibrary. All the information on their preferences and settlement can be found [here](ref_sensors.md), but the list of those available in CARLA so far goes as follow. -
Receive data on every tick. - - [Depth camera](ref_sensors.md#depth-camera). - - [Gnss sensor](ref_sensors.md#gnss-sensor). - - [IMU sensor](ref_sensors.md#imu-sensor). - - [Lidar raycast](ref_sensors.md#lidar-raycast-sensor). - - [SemanticLidar raycast](ref_sensors.md#semanticlidar-raycast-sensor). - - [Radar](ref_sensors.md#radar-sensor). - - [RGB camera](ref_sensors.md#rgb-camera). - - [RSS sensor](ref_sensors.md#rss-sensor). - - [Semantic Segmentation camera](ref_sensors.md#semantic-segmentation-camera). -
Only receive data when triggered. - - [Collision detector](ref_sensors.md#collision-detector). - - [Lane invasion detector](ref_sensors.md#lane-invasion-detector). - - [Obstacle detector](ref_sensors.md#obstacle-detector). + Most sensors can be divided in two groups: those receiving data on every tick (cameras, point clouds and some specific sensors) and those who only receive under certain circumstances (trigger detectors). CARLA provides a specific set of sensors and their blueprint can be found in carla.BlueprintLibrary. All the information on their preferences and settlement can be found [here](ref_sensors.md), but the list of those available in CARLA so far goes as follows:
+
Receive data on every tick
+ - [Depth camera](ref_sensors.md#depth-camera)
+ - [Gnss sensor](ref_sensors.md#gnss-sensor)
+ - [IMU sensor](ref_sensors.md#imu-sensor)
+ - [Lidar raycast](ref_sensors.md#lidar-raycast-sensor)
+ - [SemanticLidar raycast](ref_sensors.md#semanticlidar-raycast-sensor)
+ - [Radar](ref_sensors.md#radar-sensor)
+ - [RGB camera](ref_sensors.md#rgb-camera)
+ - [RSS sensor](ref_sensors.md#rss-sensor)
+ - [Semantic Segmentation camera](ref_sensors.md#semantic-segmentation-camera)
+
Only receive data when triggered.
+ - [Collision detector](ref_sensors.md#collision-detector)
+ - [Lane invasion detector](ref_sensors.md#lane-invasion-detector)
+ - [Obstacle detector](ref_sensors.md#obstacle-detector)
+ - [V2X sensor](ref_sensors.md#v2x-sensor) + # - PROPERTIES ------------------------- + instance_variables: + - var_name: is_listening + type: boolean + doc: > + When **True** the sensor will be waiting for data. # - METHODS ---------------------------- methods: - def_name: listen @@ -92,6 +99,15 @@ doc: > Commands the sensor to stop listening for the specified GBuffer texture. # -------------------------------------- + - def_name: send + params: + - param_name: message + type: string + doc: > + The data to send. Note: maximum string length is 100 chars. + doc: > + Instructs the sensor to send the string given by `message` to all other CustomV2XSensors on the next tick. + # -------------------------------------- - def_name: __str__ # -------------------------------------- diff --git a/PythonAPI/docs/sensor_data.yml b/PythonAPI/docs/sensor_data.yml index 1e0e477e1..cdd394a56 100644 --- a/PythonAPI/docs/sensor_data.yml +++ b/PythonAPI/docs/sensor_data.yml @@ -15,7 +15,9 @@ - Obstacle detector: carla.ObstacleDetectionEvent.
- Radar sensor: carla.RadarMeasurement.
- RSS sensor: carla.RssResponse.
- - Semantic LIDAR sensor: carla.SemanticLidarMeasurement. + - Semantic LIDAR sensor: carla.SemanticLidarMeasurement.
+ - Cooperative awareness messages V2X sensor: carla.CAMEvent.
+ - Custom V2X messages V2X sensor: carla.CustomV2XEvent. # - PROPERTIES ------------------------- instance_variables: - var_name: frame @@ -878,7 +880,7 @@ - class_name: GBufferTextureID # - DESCRIPTION ------------------------ doc: > - Defines the identifiers of each GBuffer texture (See the method `carla.Sensor.listen_to_gbuffer`). + Defines the of each GBuffer texture (See the method `carla.Sensor.listen_to_gbuffer`). # - PROPERTIES ------------------------- instance_variables: - var_name: SceneColor @@ -941,4 +943,110 @@ The texture "CustomStencil" contains the Unreal Engine custom stencil data. # -------------------------------------- + + - class_name: CAMData + parent: carla.SensorData + # - DESCRIPTION ------------------------ + doc: > + This is the data type for cooperative awareness message reception, contained in a [CAMEvent](#carlacamevent) + # - PROPERTIES ------------------------- + instance_variables: + - var_name: power + type: float - dBm + doc: > + Received power. + + # - METHODS ---------------------------- + # -------------------------------------- + methods: + - def_name: get + return: dict + doc: > + Get the CAM data. Returns a nested dictionary containing the message following the ETSI standard: - `Header`: dict - `Message`: dict + # -------------------------------------- + - def_name: __str__ + # -------------------------------------- + + - class_name: CAMEvent + parent: carla.SensorData + # - DESCRIPTION ------------------------ + doc: > + Class that defines the data provided by a **sensor.other.v2x**. This is a collection type to combine returning several [CAMData](#carlacamdata). + # - PROPERTIES ------------------------- + instance_variables: + + # - METHODS ---------------------------- + # -------------------------------------- + methods: + - def_name: get_message_count + return: int + doc: > + Get the number of received CAM's. + # -------------------------------------- + - def_name: __get_item__ + params: + - param_name: pos + type: int + # -------------------------------------- + - def_name: __iter__ + doc: > + Iterate over the [CAMData](#carlacamdata) retrieved as data. + # -------------------------------------- + - def_name: __len__ + # -------------------------------------- + + + - class_name: CustomV2XEvent + parent: carla.SensorData + # - DESCRIPTION ------------------------ + doc: > + Class that defines the data provided by a **sensor.other.v2x_custom**. This is a collection type to combine returning several [CustomV2XData](#carlacustomv2xdata). + # - PROPERTIES ------------------------- + instance_variables: + + # - METHODS ---------------------------- + # -------------------------------------- + methods: + - def_name: get_message_count + return: int + doc: > + Get the number of received CAM's. + # -------------------------------------- + - def_name: __get_item__ + params: + - param_name: pos + type: int + # -------------------------------------- + - def_name: __iter__ + doc: > + Iterate over the [CustomV2XData](#carlacustomv2xdata) retrieved as data. + # -------------------------------------- + - def_name: __len__ + # -------------------------------------- + + + - class_name: CustomV2XData + parent: carla.SensorData + # - DESCRIPTION ------------------------ + doc: > + This is the data type defining a custom V2X message. Received as part of a [CustomV2XEvent](#carlacustomv2xevent). + # - PROPERTIES ------------------------- + instance_variables: + - var_name: power + type: float - dBm + doc: > + Received power. + + # - METHODS ---------------------------- + # -------------------------------------- + methods: + - def_name: get + return: dict + doc: > + Get the custom message. Returns a nested dictionary containing the message. It has two primary keys: - `Header` : dict - `Message`: str + # -------------------------------------- + - def_name: __str__ + # -------------------------------------- + + ...