You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the data type defining the bytes of a custom V2X message. Sent by the method `[carla.Sensor.send](#carla.Sensor.send)` and received as part of a [CustomV2XEvent](#carlacustomv2xevent).
Get the custom bytes. Returns a nested dictionary containing the message. It has three primary keys: - `DataSize` : int - `MaxDataSize`: int - `Bytes`: memory view containing the bytes.
Set the custom bytes from a bytearray. Be aware that only up to `MaxDataSize` bytes are considered. If you have larger data, you need to split it manually.
Set the custom bytes directly from a string. The null termination is not transmitted. Be aware that only up to `MaxDataSize` bytes are considered. If you have larger data, you need to split it manually. Be aware: this is a convenience method for quick tests, no coding/decoding is performed.
Instructs the sensor to send the string given by `message` to all other CustomV2XSensors on the next tick.
2538
+
Instructs the sensor to send the bytes given by `message` to all other CustomV2XSensors on the next tick.
2497
2539
- **Parameters:**
2498
-
- `message` (_string_) - The data to send. Note: maximum string length is 100 chars.
2540
+
- `message` (_[carla.CustomV2XBytes](#carla.CustomV2XBytes)_) - The data to send. Note: There is a maximum data size for a single message see [carla.CustomV2XBytes](#carla.CustomV2XBytes) for more information.
Copy file name to clipboardExpand all lines: Docs/ref_sensors.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1087,18 +1087,21 @@ The function the user has to call every time to send a message. This function ne
1087
1087
- **Parameters:**
1088
1088
- `data` (_function_) - The called function with one argument containing the sensor data.
1089
1089
1090
-
The custom V2X message sensor works a little bit different than other sensors, because it has the *send* function in addition to the *listen* function, that needs to be called, before another sensor of this type will receive anything. The transmission of a custom message is only triggered, when *send* is called. Each message given to the *send* function is only transmitted once to all Custom V2X Message sensors currently spawned.
1090
+
The custom V2X message sensor works a little bit different than other sensors, because it has the *send* function in addition to the *listen* function, that needs to be called, before another sensor of this type will receive anything. The transmission of a custom message is only triggered, when *send* is called. Each message given to the *send* function is only transmitted once to all Custom V2X Message sensors currently spawned. Independent communcation channels can be created by the sensors 'channel_id' attribute. Only sensors having the same 'channel_id' are communicating with each other. This allows to create different sender/receiver groups within the system.
1091
1091
1092
1092
Example:
1093
1093
1094
1094
bp = world.get_blueprint_library().find('sensor.other.v2x_custom')
0 commit comments