车辆控制 / Vehicle Control¶
说明 / Overview
向主车输出控制量的接口,包括转向 / 油门 / 制动、轨迹跟踪、位姿直接设置。
Interfaces for sending control commands to the ego vehicle, including steering/throttle/brake, trajectory tracking, and direct pose setting.
SimOnePNCAPI.SoSetPose(mainVehicleId, poseControl)
¶
设置主车位置
Set the next position of the main vehicle.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
mainVehicleId
|
str
|
车辆ID |
必需 |
poseControl
|
SimOne_Data_Pose_Control
|
下一个车辆位置 Example: .. code-block:: python
|
必需 |
SimOnePNCAPI.SoSetDrive(mainVehicleId, driveControl)
¶
主车控制
Control the main vehicle using throttle, steering, and brake.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
mainVehicleId
|
str
|
车辆ID |
必需 |
driveControl
|
SimOne_Data_Control
|
车辆驾驶参数 Example: .. code-block:: python
|
必需 |
SimOnePNCAPI.SoSetDriveTrajectory(mainVehicleId, controlTrajectory)
¶
主车控制 - 按轨迹驾驶
Drive the vehicle along a planned trajectory.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
mainVehicleId
|
str
|
车辆ID |
必需 |
controlTrajectory
|
SimOne_Data_Control_Trajectory
|
规划轨迹 |
必需 |
返回:
| 类型 | 描述 |
|---|---|
bool
|
执行结果:成功或失败 |
SimOnePNCAPI.SoSetDriveMode(mainVehicleId, driverMode)
¶
设置主车控制模式
Set the driving mode of the vehicle dynamics.
模式包括 / Modes include:
-
ESimOne_Drive_Mode_API: 通过API控制模块驾驶 / Driving by API
-
ESimOne_Drive_Mode_Driver: 通过SimOneDriver控制驾驶 / Driving by SimOneDriver
-
ESimOne_Drive_Mode_API_Lateral: 横向API,纵向Driver / Lateral by API, longitudinal by Driver
-
ESimOne_Drive_Mode_API_Longitudinal: 横向Driver,纵向API / Lateral by Driver, longitudinal by API
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
mainVehicleId
|
str
|
车辆ID |
必需 |
driverMode
|
ESimOne_Drive_Mode
|
驾驶模式 |
必需 |
返回:
| 类型 | 描述 |
|---|---|
bool
|
执行结果:成功或失败 |
SimOnePNCAPI.SoSetDriverName(mainVehicleId, driverName)
¶
设置主车控制器的名字
Set the name of the vehicle controller (max length 8 chars).
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
mainVehicleId
|
str
|
车辆ID |
必需 |
driverName
|
str
|
驾驶员名字(最多8个字符)/ Driver name (max 8 chars) |
必需 |
返回:
| 类型 | 描述 |
|---|---|
bool
|
执行结果:成功或失败 |
SimOnePNCAPI.SoSetVehicleToInitState(mainVehicleId)
¶
重置主车状态
Reset the main vehicle to its initial state.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
mainVehicleId
|
str
|
主车ID |
必需 |
返回:
| 类型 | 描述 |
|---|---|
bool
|
执行结果:成功或失败 |