服务初始化 / Service Initialization¶
说明 / Overview
评价服务的连接与初始化接口。两种模式:
Evaluation service connection and initialization interfaces. Two modes:
- 在线模式 / Online Mode(
SoInitEvaluationService):连接到运行中的 SimOne 评价服务 / Connect to a running SimOne evaluation service - 本地数据模式 / Local Data Mode(
SoInitEvaluationServiceWithLocalData):基于本地历史数据进行评价 / Evaluate based on local historical data
SimOneEvaluationAPI.SoInitEvaluationService(mainVehicleId, serviceIP='127.0.0.1', port=8078, withMainVehicle=True, withObstacleNeeded=True)
¶
初始化评价服务
Initialize the Evaluation Service for autonomous driving algorithms.
默认情况下,评价服务将接收判决数据和GPS数据(类别:judge, mainvehicle)
By default, the evaluation service will receive judge data and GPS data (categories: judge, mainvehicle).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mainVehicleId
|
str
|
主车的ID Id of the main vehicle. |
required |
serviceIP
|
str
|
评价服务的IP地址 IP address of the evaluation service. Default is "127.0.0.1". |
'127.0.0.1'
|
port
|
int
|
评价服务的端口号 Port number for the evaluation server. Default is 8078. |
8078
|
withMainVehicle
|
bool
|
是否默认发送主车数据到评价服务器 Whether to send MainVehicle data to the evaluation server by default. Default is True. |
True
|
withObstacleNeeded
|
bool
|
是否发送障碍物数据到评价服务器 Whether to send Obstacle data to the evaluation server. Default is True. |
True
|
Returns:
| Type | Description |
|---|---|
bool
|
执行结果:成功或失败。Execution outcome: success or failure. |
SimOneEvaluationAPI.SoInitEvaluationServiceWithLocalData(mainVehicleId, withMainVehicle=True, withObstacleNeeded=True)
¶
初始化评价服务,并使用本地存储数据
Initialize the Evaluation Service for autonomous driving algorithms with local data storage.
默认情况下,评价服务将接收判决数据和GPS数据(类别:judge, mainvehicle)
By default, the evaluation service will receive judge data and GPS data (categories: judge, mainvehicle).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mainVehicleId
|
str
|
主车的ID Id of the main vehicle. |
required |
withMainVehicle
|
bool
|
是否默认发送主车数据到评价服务器 Whether to send MainVehicle data to the evaluation server by default. Default is True. |
True
|
withObstacleNeeded
|
bool
|
是否发送障碍物数据到评价服务器 Whether to send Obstacle data to the evaluation server. Default is True. |
True
|
Returns:
| Type | Description |
|---|---|
bool
|
执行结果:成功或失败 Execution outcome: success or failure. |