SimOnePNCAPI module
- SimOnePNCAPI. SoAPISetScenarioEventCB ( cb )
-
场景事件回调
Register a callback function for scenario event handling.
此函数用于注册场景事件的回调函数,以应对场景中的特定事件
This function is used to register a callback function for handling specific events in a scenario.
- 参数 :
-
-
cb ( function ) –
场景事件的回调函数
Callback function for scenario events.
-
source ( str ) –
发送消息的车辆ID
Vehicle ID sending the message.
-
target ( str ) –
消息ID
Message ID.
-
type ( str ) –
消息类型(“Command”或“Event”)
Message type (“Command” or “Event”).
-
content ( str ) –
消息内容
Message content.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoGetControlMode ( mainVehicleId , controlModeData )
-
获取车辆控制模式
Retrieve the vehicle’s control mode.
此函数用于获取车辆的当前控制模式
This function is used to retrieve the current control mode of the vehicle.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
controlModeData ( SimOne_Data_Control_Mode ) –
当前车辆控制模式
Current vehicle control mode.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoGetDriverControl ( mainVehicleId , driverControlData )
-
获取SimOneDriver控制信号
Get control signals from SimOneDriver.
此函数用于在驾驶过程中获取SimOneDriver的控制信息
This function is used to get control information from SimOneDriver while driving.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
driverControlData ( SimOne_Data_Control ) –
驾驶控制信息
Driving control information.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoGetVehicleState ( mainVehicleId , data )
-
获取通过SoRegisterVehicleState注册的主车状态信息
Get chassis info which was registered by SoRegisterVehicleState.
此函数用于获取通过SoRegisterVehicleState注册的底盘信息
This function is used to retrieve chassis information that was registered through SoRegisterVehicleState.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
data ( SimOne_Data_Vehicle_Extra ) –
通过SoRegisterVehicleState注册的底盘信息
Chassis information registered by SoRegisterVehicleState.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoGetWayPoints ( mainVehicleId , wayPointsData )
-
获取案例主车路径点
Retrieve the main vehicle’s waypoints in a scenario.
此函数用于获取由案例编辑生成的主车路径点
This function is used to retrieve the main vehicle’s waypoints generated by case editing.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
wayPointsData ( SimOne_Data_WayPoints ) –
由案例编辑生成的路径点
Waypoints generated by case editing.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoRegisterVehicleState ( mainVehicleId , data , size )
-
注册SimOne_Data_Gps包含的状态以外的主车状态信息
Register for receiving additional vehicle state information beyond what is included in SimOne_Data_Gps.
此函数用于注册获取来自车辆动力学的底盘信息
This function is used to register for obtaining chassis information from Vehicle Dynamics.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
data ( list [ ESimOne_Data_Vehicle_State ] ) –
需要注册的车辆状态信息的数组
Array of the vehicle-state expected to be registered.
-
size ( int ) –
需要注册的车辆状态数量
Number of vehicle-states expected to register.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoSetDrive ( mainVehicleId , driveControl )
-
主车控制
Drive the vehicle using throttle, steering, brake, etc.
此函数用于通过油门、方向盘、刹车等参数控制主车行驶
This function is used to control the main vehicle’s movement using parameters such as throttle, steering, and brake.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
driveControl ( SimOne_Data_Control ) –
用于车辆驾驶的参数
Parameters for vehicle driving.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoSetDriveMode ( mainVehicleId , driverMode )
-
设置主车控制模式
Set the driving mode of the vehicle dynamics.
此函数用于设置车辆动力学的驾驶模式
This function is used to set the driving mode of the vehicle dynamics.
模式包括:
Modes include: - ESimOne_Drive_Mode_API: 通过API控制模块驾驶
Driving by API controlling module.
-
ESimOne_Drive_Mode_Driver: 通过SimOneDriver控制模块驾驶
Driving by SimOneDriver controlling module.
-
ESimOne_Drive_Mode_API_Lateral: 横向控制由API模块控制,纵向控制由SimOneDriver模块控制
Lateral control under API module, longitudinal control under SimOneDriver module.
-
ESimOne_Drive_Mode_API_Longitudinal: 横向控制由SimOneDriver模块控制,纵向控制由API模块控制
Lateral control under SimOneDriver module, longitudinal control under API module.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
driverMode ( ESimOne_Drive_Mode ) –
车辆驾驶控制模式
Vehicle driving control mode.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
-
- SimOnePNCAPI. SoSetDriveTrajectory ( mainVehicleId , controlTrajectory )
-
主车控制 - 按轨迹驾驶
Drive the vehicle following a specified trajectory.
此函数用于按照预定轨迹控制主车行驶
This function is used to control the main vehicle’s movement along a planned trajectory.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
controlTrajectory ( SimOne_Data_Control_Trajectory ) –
车辆规划轨迹
Vehicle’s planned trajectory.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoSetDriverName ( mainVehicleId , driverName )
-
设置主车控制器的名字
Set the name of the vehicle’s controller.
此函数用于设置主车控制器的名字,最大长度为8个字符
This function is used to set the name of the vehicle’s controller, with a maximum length of 8 characters.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
driverName ( str ) –
要设置的驾驶员名字,最大长度为8个字符
Driver name to be set, with a maximum length of 8 characters.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoSetPose ( mainVehicleId , poseControl )
-
设置主车位置
Set the position of the main vehicle.
此函数用于设置主车的下一个位置
This function is used to set the next position of the main vehicle.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
poseControl ( SimOne_Data_Pose_Control ) –
要设置的下一个车辆位置
The next vehicle position to be set.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoSetSignalLights ( mainVehicleId , pSignalLight )
-
设置车辆信号灯状态
Set the state of the vehicle’s signal lights.
此函数用于设置车辆的灯光信号状态
This function is used to set the state of the vehicle’s light signals.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
pSignalLight ( SimOne_Data_Signal_Lights ) –
要设置的灯光信号
Light signal to be set.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool
- SimOnePNCAPI. SoSetVehicleEvent ( mainVehicleId , vehicleEventInfo )
-
设置主车预警消息
Set warning messages for the main vehicle.
此函数用于设置主车在驾驶过程中生成的事件信号
This function is used to set event signals generated while the main vehicle is driving.
- 参数 :
-
-
mainVehicleId ( str ) –
车辆ID
Vehicle ID.
-
vehicleEventInfo ( SimOne_Data_Vehicle_EventInfo ) –
驾驶过程中生成的事件信号
Event signal generated while driving.
-
- 返回 :
-
执行结果:成功或失败
Execution outcome: success or failure.
- 返回类型 :
-
bool