SimOneServiceAPI module
- SimOneServiceAPI. SoAPIContinue ( )
-
继续运行当前处于暂停状态的案例
Continue to run the current case which is in pause.
此函数用于在非帧同步调试场景中继续SimOne环境中当前暂停的执行
This function is used to continue the currently paused execution in the SimOne environment in non-frame-synchronized debugging scenarios.
- 返回 :
-
继续操作的返回状态,通常为0
The return status of the continue operation, typically 0. :rtype: int
- SimOneServiceAPI. SoAPIGetCaseInfo ( data )
-
获取案例详情
Get detailed information about the case.
此函数用于获取当前SimOne案例的详细信息,包括案例名称、案例ID等
This function retrieves detailed information about the current SimOne case, including case name, case ID, etc.
- 参数 :
-
data ( SimOne_Data_CaseInfo ) –
存储案例信息的数据结构
The data structure storing case information.
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure. :rtype: bool
- SimOneServiceAPI. SoAPIGetVersion ( )
-
获取当前库的版本号
Retrieve the current API version number.
此函数用于获取API的当前版本号
This function is used to get the current version number of the API.
- 返回 :
-
API的版本号
API version number.
- 返回类型 :
-
str
- SimOneServiceAPI. SoAPINextFrame ( frame )
-
进行下一帧
Proceed to the next frame in a frame-synchronized scene.
在帧同步的场景中使用,此函数用于将SimOne环境的执行推进到下一帧
This function is used in frame-synchronized scenes to advance the execution of the SimOne environment to the next frame. 当SoInitSimOneAPI的参数isFrameSync设置为true时使用。Use when the ‘isFrameSync’ parameter of SoInitSimOneAPI is set to true.
- 参数 :
-
frame ( int ) –
当前帧号,由SoAPIWait返回
The current frame number, returned by SoAPIWait.
- SimOneServiceAPI. SoAPIPause ( )
-
暂停当前运行案例
Pause the current running case.
此函数用于暂停SimOne环境中的当前执行,特别适用于非帧同步调试场景
This function is used to pause the current execution in the SimOne environment, particularly suited for non-frame-synchronized debugging scenarios.
- 返回 :
-
暂停操作的返回状态,通常为0
The return status of the pause operation, typically 0. :rtype: int
- SimOneServiceAPI. SoAPISetFrameCB ( startcb , stopcb )
-
在仿真场景中为每个帧设置回调函数,在每个帧的开始和结束时调用指定的回调函数
Register callback functions to be called at the beginning and end of each frame in a simulation scene.
- 参数 :
-
-
startcb ( func ) –
每帧开始时调用的回调函数
Callback function called at the beginning of each frame.
-
stopcb ( func ) –
每帧结束时调用的回调函数
Callback function called at the end of each frame.
-
- 返回 :
-
设置回调函数的执行结果,成功或失败
The execution outcome of setting the callback functions, success or failure. :rtype: bool
- SimOneServiceAPI. SoAPISetMainVehicleStatusUpdateCB ( cb )
-
注册用于获取主车状态更新的回调函数
Register a callback function for receiving updates on the main vehicle’s status.
- 参数 :
-
cb ( func ) –
用于接收主车状态更新的回调函数
Callback function that will be invoked with updates on the main vehicle’s status.
- 返回 :
-
注册回调函数的执行结果,成功或失败
Execution outcome of registering the callback function, success or failure. :rtype: bool
- SimOneServiceAPI. SoAPIWait ( )
-
获取当前帧号
Retrieve the current frame number.
当SoInitSimOneAPI的参数isFrameSync设置为true时,此函数用于获取SimOne环境中的当前帧号
This function is used to obtain the current frame number in the SimOne environment when the ‘isFrameSync’ parameter of SoInitSimOneAPI is set to true.
- 返回 :
-
当前帧号
The current frame number. :rtype: int
- SimOneServiceAPI. SoGetCaseRunStatus ( )
-
获取案例运行状态
Get the current running status of the case.
此函数用于查询SimOne案例的当前运行状态,如是否正在运行或已停止
This function is used to query the current running status of the SimOne case, such as whether it is running or has stopped.
- 返回 :
-
案例的运行状态,如正在运行或已停止
The running status of the case, such as running or stopped. :rtype: ESimOne_Case_Status
- SimOneServiceAPI. SoGetHDMapData ( hdMap )
-
获取高精度地图元数据信息
Retrieve high-precision map metadata information.
- 参数 :
-
hdMap ( SimOne_Data_Map ) –
高精度地图的查询数据
Query data for high-precision map retrieval.
- 返回 :
-
获取高精度地图数据的执行结果,成功或失败
Execution outcome of retrieving high-precision map data, success or failure. :rtype: bool
- SimOneServiceAPI. SoGetMainVehicleList ( data )
-
获取主车信息列表
Retrieve the list of main vehicle information.
此函数用于获取SimOne环境中所有主车的信息列表,包括车辆的ID、数量、类型等
This function is used to retrieve a list of information for all main vehicles in the SimOne environment, including vehicle ID, number, type, etc.
- 参数 :
-
data ( SimOne_Data_MainVehicle_Info ) –
用于存储主车信息的数据结构
The data structure used to store main vehicle information.
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure. :rtype: bool
- SimOneServiceAPI. SoGetMainVehicleStatus ( mainVehicleId , data )
-
获取指定主车的状态信息
Retrieve the status information of the specified main vehicle.
- 参数 :
-
-
mainVehicleId ( str ) –
主车的唯一标识符
The unique identifier of the main vehicle.
-
data ( SimOne_Data_MainVehicle_Status ) –
用于接收主车状态信息的数据结构
Data structure to receive the main vehicle’s status information.
-
- 返回 :
-
获取状态信息的执行结果,成功或失败
Execution outcome of retrieving the status information, success or failure. :rtype: bool
- SimOneServiceAPI. SoInitSimOneAPI ( mainVehicleId = '0' , isFrameSync = 0 , serverIP = '127.0.0.1' , port = 23789 , startcase = 0 , stopcase = 0 , registerNodeId = 0 )
-
初始化SimOne API
Initialize SimOne API for autonomous driving algorithms.
此函数用于初始化SimOne API,用于自动驾驶算法的测试和模拟
This function is used to initialize the SimOne API for testing and simulating autonomous driving algorithms.
- 参数 :
-
-
mainVehicleId ( str ) –
主车ID,默认为’0’
Vehicle ID, default is ‘0’.
-
isFrameSync ( int ) –
是否与SimOne同步帧,默认为0
Whether to synchronize frames with SimOne, default is 0.
-
serverIP ( str ) –
BridgeIO服务器IP,默认为’127.0.0.1’
BridgeIO server IP, default is ‘127.0.0.1’.
-
port ( int ) –
BridgeIO服务器端口,默认为23789
BridgeIO server port, default is 23789.
-
startcase ( int ) –
案例开始前调用的回调函数,默认为0
Callback function to be called before the case starts, default is 0.
-
stopcase ( int ) –
案例结束后调用的回调函数,默认为0
Callback function to be called after the case ends, default is 0.
-
registerNodeId ( int ) –
未使用,默認為0
Not in use, default is 0.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure. :rtype: bool
- SimOneServiceAPI. SoInitSimOneAPIEx ( vehicle_ids , isFrameSync = 0 , serverIP = '127.0.0.1' , port = 23789 , startcase = 0 , stopcase = 0 , registerNodeId = 0 )
-
多车版本-初始化SimOne API
Initialize SimOne API for multi-vehicle version in autonomous driving algorithm.
此函数用于初始化SimOne API,适用于多车版本的自动驾驶算法测试和模拟
This function initializes the SimOne API for multi-vehicle version, suitable for testing and simulating autonomous driving algorithms.
- 参数 :
-
-
vehicle_ids ( list ) –
主车ID列表,必须为数字字符串
List of main vehicle IDs, must be digit strings.
-
isFrameSync ( int ) –
是否与SimOne同步帧,默认为0
Whether to synchronize frames with SimOne, default is 0.
-
serverIP ( str ) –
BridgeIO服务器IP,默认为’127.0.0.1’
BridgeIO server IP, default is ‘127.0.0.1’.
-
port ( int ) –
BridgeIO服务器端口,默认为23789
BridgeIO server port, default is 23789.
-
startcase ( int ) –
案例开始前调用的回调函数,默认为0
Callback function to be called before the case starts, default is 0.
-
stopcase ( int ) –
案例结束后调用的回调函数,默认为0
Callback function to be called after the case ends, default is 0.
-
registerNodeId ( int ) –
未使用,默認為0
Not in use, default is 0.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOneServiceAPI. SoInitSimOneAPIExWithTimeOut ( vehicle_ids , isFrameSync = 0 , serverIP = '127.0.0.1' , port = 23789 , timeOutMS = -1 , startcase = 0 , stopcase = 0 , registerNodeId = 0 )
-
带超时的多车版本初始化SimOne API
Initialize SimOne API for multi-vehicle version with timeout in autonomous driving algorithm.
此函数用于带超时设置的多车版本SimOne API初始化,适用于自动驾驶算法的测试和模拟
This function initializes the SimOne API for multi-vehicle version with a timeout setting, suitable for testing and simulating autonomous driving algorithms.
- 参数 :
-
-
vehicle_ids ( list ) –
车辆ID列表,必须为数字字符串
List of vehicle IDs, must be digit strings.
-
isFrameSync ( int ) –
是否与SimOne同步帧,默认为0
Whether to synchronize frames with SimOne, default is 0.
-
serverIP ( str ) –
BridgeIO服务器IP,默认为’127.0.0.1’
BridgeIO server IP, default is ‘127.0.0.1’.
-
port ( int ) –
BridgeIO服务器端口,默认为23789
BridgeIO server port, default is 23789.
-
timeOutMS ( int ) –
超时设置,默認為-1
Timeout setting, default is -1.
-
startcase ( int ) –
案例开始前调用的回调函数,默认为0
Callback function to be called before the case starts, default is 0.
-
stopcase ( int ) –
案例结束后调用的回调函数,默认为0
Callback function to be called after the case ends, default is 0.
-
registerNodeId ( int ) –
未使用,默認為0
Not in use, default is 0.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure. :rtype: bool
- SimOneServiceAPI. SoInitSimOneAPIWithTimeOut ( mainVehicleId = '0' , isFrameSync = 0 , serverIP = '127.0.0.1' , port = 23789 , timeOutMS = -1 , startcase = 0 , stopcase = 0 , registerNodeId = 0 )
-
初始化SimOne API 带超时
Initialize SimOne API for autonomous driving algorithm with timeout.
此函数用于带超时设置的初始化SimOne API,适用于自动驾驶算法测试和模拟
This function initializes the SimOne API with a timeout setting, suitable for testing and simulating autonomous driving algorithms.
- 参数 :
-
-
mainVehicleId ( str ) –
主车ID,默认为’0’
Vehicle ID, default is ‘0’.
-
isFrameSync ( int ) –
是否与SimOne同步帧,默认为0
Whether to synchronize frames with SimOne, default is 0.
-
serverIP ( str ) –
BridgeIO服务器IP,默认为’127.0.0.1’
BridgeIO server IP, default is ‘127.0.0.1’.
-
port ( int ) –
BridgeIO服务器端口,默认为23789
BridgeIO server port, default is 23789.
-
timeOutMS ( int ) –
超时设置,默認為-1
Timeout setting, default is -1.
-
startcase ( int ) –
案例开始前调用的回调函数,默认为0
Callback function to be called before the case starts, default is 0.
-
stopcase ( int ) –
案例结束后调用的回调函数,默认为0
Callback function to be called after the case ends, default is 0.
-
registerNodeId ( int ) –
未使用,默認為0
Not in use, default is 0.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure. :rtype: bool
- SimOneServiceAPI. SoSetLogOut ( logLevel , * args )
-
日志设置接口
Configure logging interface.
此函数用于配置日志系统的日志级别
This function is used to configure the log level of the logging system.
- 参数 :
-
-
logLevel ( ESimOne_LogLevel_Type ) –
日志级别
The log level.
-
args –
额外参数,用于配置日志系统
Additional arguments for configuring the logging system.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOneServiceAPI. SoTerminateSimOneAPI ( )
-
退出API服务
Stop SimOne API service.
此函数用于停止并退出SimOne API服务,适用于自动驾驶算法测试和模拟后的资源释放
This function is used to stop and exit the SimOne API service, suitable for releasing resources after testing and simulating autonomous driving algorithms.
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure. :rtype: bool