PNCAPI: Planning and Control
PNCAPI
PNCAPI (Planning & Control API) is used to control the motion behavior of the simulated Ego Vehicle. Decision-making, planning, and control algorithms use object-level ground-truth data from multi-sensor fusion for validation. The algorithm's control messages are passed into the SimOne simulation system via PNCAPI, enabling verification of the Ego Vehicle's control results.
SimOne provides three Ego Vehicle drive modes:
| Drive Mode |
Description |
Corresponding API |
| Pose Drive |
Directly sets the spatial coordinates and heading of the Ego Vehicle; suitable for playback or trajectory reproduction Scenarios |
SetPose |
| Throttle/Brake/Steering Drive |
Drives the Ego Vehicle via control signals (including dynamics); suitable for control algorithm validation |
SetDrive |
| Planning Trajectory Drive |
Drives the Ego Vehicle via planned trajectory points (including dynamics); cannot be used simultaneously with SetDrive |
SetDriveTrajectory |
For detailed parameter descriptions, refer to the C++ API Reference. For complete usage examples, refer to PNC Examples.
API Quick Reference
Select Vehicle and Initialize
| Event |
C++ API |
Python API |
| Register extended state information of the Ego Vehicle |
RegisterVehicleState |
SoRegisterVehicleState |
| Set the name of the Ego Vehicle Controller |
SetDriverName |
SoSetDriverName |
Vehicle Pose and State
| Event |
C++ API |
Python API |
| Set Ego Vehicle Pose |
SetPose |
SoSetPose |
| Reset Ego Vehicle State |
SetVehicleToInitState |
SoSetVehicleToInitState |
Vehicle Control
| Event |
C++ API |
Python API |
| Ego Vehicle Control (throttle/brake/steering) |
SetDrive |
SoSetDrive |
| Set Ego Vehicle Control Mode |
SetDriveMode |
SoSetDriveMode |
Trajectory and Planning Control
| Event |
C++ API |
Python API |
| Set Predicted Trajectory |
SetTrajectory |
— |
| Ego Vehicle Control (via planning trajectory) |
SetDriveTrajectory |
SoSetDriveTrajectory |
Get State
| Event |
C++ API |
Python API |
Get Ego Vehicle state information registered via RegisterVehicleState |
GetVehicleState |
SoGetVehicleState |
| Get Vehicle Control Mode |
GetControlMode |
SoGetControlMode |
| Get SimOneDriver Control Signal |
GetDriverControl |
SoGetDriverControl |
| Get Use Case Ego Vehicle Waypoints |
GetWayPoints |
SoGetWayPoints |
| Event |
C++ API |
Python API |
| Set Ego Vehicle Warning Message |
SetVehicleEvent |
SoSetVehicleEvent |
| Set Vehicle Signal Light State |
SetSignalLights |
SoSetSignalLights |
| Scenario Event callback |
SetScenarioEventCB |
SoAPISetScenarioEventCB |