Skip to content

车辆控制 / 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.

Parameters:

Name Type Description Default
mainVehicleId str

车辆ID
Vehicle ID

required
poseControl SimOne_Data_Pose_Control

下一个车辆位置
Next vehicle position

Example: .. code-block:: python

   pose = SimOne_Data_Pose_Control()
   pose.position.x = 10.0
   pose.position.y = 20.0
   SoSetPose("MainVehicle", pose)
required

SimOnePNCAPI.SoSetDrive(mainVehicleId, driveControl)

主车控制

Control the main vehicle using throttle, steering, and brake.

Parameters:

Name Type Description Default
mainVehicleId str

车辆ID
Vehicle ID

required
driveControl SimOne_Data_Control

车辆驾驶参数
Driving parameters

Example: .. code-block:: python

   control = SimOne_Data_Control()
   control.throttle = 0.5
   control.steering = 0.1
   SoSetDrive("MainVehicle", control)
required

SimOnePNCAPI.SoSetDriveTrajectory(mainVehicleId, controlTrajectory)

主车控制 - 按轨迹驾驶

Drive the vehicle along a planned trajectory.

Parameters:

Name Type Description Default
mainVehicleId str

车辆ID
Vehicle ID

required
controlTrajectory SimOne_Data_Control_Trajectory

规划轨迹
Planned trajectory

required

Returns:

Type Description
bool

执行结果:成功或失败
Success or failure

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

Parameters:

Name Type Description Default
mainVehicleId str

车辆ID
Vehicle ID

required
driverMode ESimOne_Drive_Mode

驾驶模式
Driving mode

required

Returns:

Type Description
bool

执行结果:成功或失败
Success or failure

SimOnePNCAPI.SoSetDriverName(mainVehicleId, driverName)

设置主车控制器的名字

Set the name of the vehicle controller (max length 8 chars).

Parameters:

Name Type Description Default
mainVehicleId str

车辆ID
Vehicle ID

required
driverName str

驾驶员名字(最多8个字符)/ Driver name (max 8 chars)

required

Returns:

Type Description
bool

执行结果:成功或失败
Success or failure

SimOnePNCAPI.SoSetVehicleToInitState(mainVehicleId)

重置主车状态

Reset the main vehicle to its initial state.

Parameters:

Name Type Description Default
mainVehicleId str

主车ID
Vehicle ID

required

Returns:

Type Description
bool

执行结果:成功或失败
Success or failure