V2XAPI¶
说明 / Overview
车路协同接口(Vehicle-to-Everything),用于获取路侧设备(RSU)广播的交通信息,支持 V2X 仿真场景中的信息订阅。使用前需在主车配置中挂载 OBU 传感器。
Vehicle-to-Everything interface for receiving traffic information broadcast by roadside units (RSU). Supports V2X simulation scenarios. An OBU sensor must be mounted on the ego vehicle before use.
V2X 数据获取 / V2X Data Retrieval¶
SimOneV2XAPI.SoGetV2XInfo(mainVehicleId, sensorId, infoType, detectionData)
¶
获得对应车辆编号V2X中的UPER编码之后的v2x消息
Get V2X UPER ASN Message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mainVehicleId
|
string
|
车辆ID |
required |
sensorId
|
string
|
传感器ID |
required |
infoType
|
int
|
OBU消息类型,对应枚举 ESimOne_V2X_MessageFrame_PR |
required |
detectionData
|
SimOne_Data_V2XNFS
|
V2X ASN数据 |
required |
Returns:
| Type | Description |
|---|---|
bool
|
executive outcome: success/faile |
SimOneV2XAPI.SoApiSetV2XInfoUpdateCB(cb)
¶
获得对应车辆编号V2X中的UPER编码之后的v2x消息更新回调
Register the callback function for applying V2X UPER ASN message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cb
|
function
|
OBU消息回调函数,格式:cb(mainVehicleId, sensorId, V2XNFSData) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
executive outcome: success/faile |