NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
VehicleIO Actuators Interface

Detailed Description

Defines C API functions to access the VehicleIO car controller box.

Data Structures

struct  dwVehicleIOCapabilities
 VehicleIO Capabilities. More...
 

Macros

#define DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES   75
 

Typedefs

typedef struct dwVehicleIOObject * dwVehicleIOHandle_t
 
typedef struct dwVehicleIOCapabilities dwVehicleIOCapabilities
 VehicleIO Capabilities. More...
 

Functions

DW_API_PUBLIC dwStatus dwVehicleIO_initialize (dwVehicleIOHandle_t *const obj, dwVehicleIOType const type, const dwVehicle *const properties, dwContextHandle_t const ctx)
 Initialize VehicleIO and prepare all internal structures. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_initializeFromRig (dwVehicleIOHandle_t *const obj, dwConstRigHandle_t const rig, dwContextHandle_t const ctx)
 Initialize VehicleIO and prepare all internal structures from Rig Configuration. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_reset (dwVehicleIOHandle_t const obj)
 Reset VehicleIO to default state. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_release (dwVehicleIOHandle_t const obj)
 Release used memory and close all modules. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_selectDriverOverrides (bool const throttleOverride, bool const steeringOverride, bool const brakeOverride, bool const gearOverride, dwVehicleIOHandle_t const obj)
 Select the overrides that the driver can use to disable vehicle control. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_consumeDataPacket (const dwDataPacket *const pkt, uint32_t const sensorId, dwVehicleIOHandle_t const obj)
 Similar to dwVehicleIO_consumeCANFrame. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getCapabilities (dwVehicleIOCapabilities *const caps, dwVehicleIOHandle_t const obj)
 Retrieve current VehicleIO capabilities. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendSafetyCommand (const dwVehicleIOSafetyCommand *const safeCmd, dwVehicleIOHandle_t const obj)
 Send a vehicle safety command to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendNonSafetyCommand (const dwVehicleIONonSafetyCommand *const nonSafeCmd, dwVehicleIOHandle_t const obj)
 Send a vehicle non-safety command to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleSafetyState (dwVehicleIOSafetyState *const safeState, dwVehicleIOHandle_t const obj)
 Retrieve current vehicle safety state. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleNonSafetyState (dwVehicleIONonSafetyState *const nonSafeState, dwVehicleIOHandle_t const obj)
 Retrieve current vehicle non-safety state. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleActuationFeedback (dwVehicleIOActuationFeedback *const actuationFeedback, dwVehicleIOHandle_t const obj)
 Retrieve current vehicle actuation feedback. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendASILCommand (dwVehicleIOASILCommandE2EWrapper const *const asilCmd, dwVehicleIOHandle_t const obj)
 Send a vehicle command with ASIL rating to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendQMCommand (dwVehicleIOQMCommand const *const qmCmd, dwVehicleIOHandle_t const obj)
 Send a vehicle command with QM rating to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendEgomotionData (dwValEgomotion const *const egomotion, dwVehicleIOHandle_t const obj)
 Send a vehicle egomotion data to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendCalibrationData (dwValSensorCalibration const *const sensorCalibration, dwVehicleIOHandle_t const obj)
 Send a vehicle sensor calibration to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleASILState (dwVehicleIOASILStateE2EWrapper *const asilState, dwVehicleIOHandle_t const obj)
 Retrieve current vehicle state with ASIL rating. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleQMState (dwVehicleIOQMState *const qmState, dwVehicleIOHandle_t const obj)
 Retrieve current vehicle state with QM rating. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_setDrivingMode (dwVehicleIODrivingMode const mode, dwVehicleIOHandle_t const obj)
 Setting driving mode allows to control the behaviour of VehicleIO module with regards to the permitted commands and number of safety checks performed. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_addDataSensor (uint32_t const vehicleIOId, dwSensorHandle_t const sensorHandle, dwVehicleIOHandle_t const obj)
 Add CAN sensor handle and corresponding VehicleIO configuration ID. More...
 

Macro Definition Documentation

◆ DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES

#define DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES   75

Definition at line 25 of file VehicleIOCapabilities.h.

Typedef Documentation

◆ dwVehicleIOCapabilities

VehicleIO Capabilities.

Note that this some capabilities are imposed by the VehicleIO module itself. For dynamic (vehicle-reported) capabilities,

See also
dwVehicleIOCapabilityState.

◆ dwVehicleIOHandle_t

typedef struct dwVehicleIOObject* dwVehicleIOHandle_t

Definition at line 51 of file VehicleIO.h.

Function Documentation

◆ dwVehicleIO_addDataSensor()

DW_API_PUBLIC dwStatus dwVehicleIO_addDataSensor ( uint32_t const  vehicleIOId,
dwSensorHandle_t const  sensorHandle,
dwVehicleIOHandle_t const  obj 
)

Add CAN sensor handle and corresponding VehicleIO configuration ID.

Allows sending commands to multiple sensors. For manual VehicleIO initialization with single CAN bus, a vehicleIO ID of 0 is expected.

@req{GID-AV_REQ-6875814}

Parameters
[in]vehicleIOIdSpecifies ID of vehicle IO configuration.
[in]sensorHandleSpecifies the underlying VehicleIO CAN sensor.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle or sensorHandle are invalid DW_SUCCESS - if the call was successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_consumeDataPacket()

DW_API_PUBLIC dwStatus dwVehicleIO_consumeDataPacket ( const dwDataPacket *const  pkt,
uint32_t const  sensorId,
dwVehicleIOHandle_t const  obj 
)

Similar to dwVehicleIO_consumeCANFrame.

Expects a data packet generated by a data sensor. Used for socket based vehicle communication.

@req{GID-AV_REQ-6874207}

Parameters
[in]pktdata packet to be parsed by the controller.
[in]sensorIdSpecifies index of data sensor that message came from.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_INVALID_ARGUMENT - if given pkt is null
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_getCapabilities()

DW_API_PUBLIC dwStatus dwVehicleIO_getCapabilities ( dwVehicleIOCapabilities *const  caps,
dwVehicleIOHandle_t const  obj 
)

Retrieve current VehicleIO capabilities.

@req{GID-AV_REQ-6874208}

Parameters
[out]capsreturned VehicleIO capabilities.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the call was successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_getVehicleActuationFeedback()

DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleActuationFeedback ( dwVehicleIOActuationFeedback *const  actuationFeedback,
dwVehicleIOHandle_t const  obj 
)

Retrieve current vehicle actuation feedback.

Note that if called immediately after sending a new command it might not be reflected in the status, as the command needs to be executed and reported back by the vehicle.

NOTE: This function will be deprecated in a future release. Please use use dwVehicleIO_getVehicleASILState or dwVehicleIO_getVehicleQMState instead.

Parameters
[out]actuationFeedbackreturned actuation feedback.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_getVehicleASILState()

DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleASILState ( dwVehicleIOASILStateE2EWrapper *const  asilState,
dwVehicleIOHandle_t const  obj 
)

Retrieve current vehicle state with ASIL rating.

Note that if called immediately after sending a new command it might not be reflected in the status, as the command needs to be executed and reported back by the vehicle.

@req{GID-AV_REQ-6875801}

Parameters
[out]asilStatereturned vehicle state with ASIL rating.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_getVehicleNonSafetyState()

DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleNonSafetyState ( dwVehicleIONonSafetyState *const  nonSafeState,
dwVehicleIOHandle_t const  obj 
)

Retrieve current vehicle non-safety state.

Note that if called immediately after sending a new command it might not be reflected in the status, as the command needs to be executed and reported back by the vehicle.

NOTE: This function will be deprecated in a future release. Please use use dwVehicleIO_getVehicleASILState or dwVehicleIO_getVehicleQMState instead.

Parameters
[out]nonSafeStatereturned vehicle non-safety RoV state.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_getVehicleQMState()

DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleQMState ( dwVehicleIOQMState *const  qmState,
dwVehicleIOHandle_t const  obj 
)

Retrieve current vehicle state with QM rating.

Note that if called immediately after sending a new command it might not be reflected in the status, as the command needs to be executed and reported back by the vehicle.

@req{GID-AV_REQ-6875802}

Parameters
[out]qmStatereturned vehicle RoV state with QM rating.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_getVehicleSafetyState()

DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleSafetyState ( dwVehicleIOSafetyState *const  safeState,
dwVehicleIOHandle_t const  obj 
)

Retrieve current vehicle safety state.

Note that if called immediately after sending a new command it might not be reflected in the status, as the command needs to be executed and reported back by the vehicle.

NOTE: This function will be deprecated in a future release. Please use use dwVehicleIO_getVehicleASILState or dwVehicleIO_getVehicleQMState instead.

Parameters
[out]safeStatereturned vehicle safety state.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_initialize()

DW_API_PUBLIC dwStatus dwVehicleIO_initialize ( dwVehicleIOHandle_t *const  obj,
dwVehicleIOType const  type,
const dwVehicle *const  properties,
dwContextHandle_t const  ctx 
)

Initialize VehicleIO and prepare all internal structures.

@req{GID-AV_REQ-6874197}

Parameters
[out]objA pointer to the car controller handle for the created module.
[in]typeSpecifies the VehicleIO controller type.
[in]propertiesVehicle properties as described by dwRig module.
[in]ctxSpecifies the handler to the DriveWorks context.
Returns
DW_INVALID_ARGUMENT - if any of the given arguments are not valid
DW_NOT_IMPLEMENTED - if given type is not implemented
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwVehicleIO_initializeFromRig()

DW_API_PUBLIC dwStatus dwVehicleIO_initializeFromRig ( dwVehicleIOHandle_t *const  obj,
dwConstRigHandle_t const  rig,
dwContextHandle_t const  ctx 
)

Initialize VehicleIO and prepare all internal structures from Rig Configuration.

@req{GID-AV_REQ-6874197}

Parameters
[out]objA pointer to the car controller handle for the created module.
[in]rigSpecifies the handler to the Rig Configuration.
[in]ctxSpecifies the handler to the DriveWorks context.
Returns
DW_INVALID_ARGUMENT - if any of the given arguments are not valid
DW_NOT_IMPLEMENTED - if given type is not implemented
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwVehicleIO_release()

DW_API_PUBLIC dwStatus dwVehicleIO_release ( dwVehicleIOHandle_t const  obj)

Release used memory and close all modules.

Connection to VehicleIO will be closed. No more car commands can be accepted when module is released.

@req{GID-AV_REQ-6874202}

Parameters
[in]objThe car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: Yes

◆ dwVehicleIO_reset()

DW_API_PUBLIC dwStatus dwVehicleIO_reset ( dwVehicleIOHandle_t const  obj)

Reset VehicleIO to default state.

@req{GID-AV_REQ-6874198}

Parameters
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
Note
This would not perform any changes regarding current vehicle state.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_selectDriverOverrides()

DW_API_PUBLIC dwStatus dwVehicleIO_selectDriverOverrides ( bool const  throttleOverride,
bool const  steeringOverride,
bool const  brakeOverride,
bool const  gearOverride,
dwVehicleIOHandle_t const  obj 
)

Select the overrides that the driver can use to disable vehicle control.

@req{GID-AV_REQ-6874199}

Parameters
[in]throttleOverrideEnables driver override by throttle application
[in]steeringOverrideEnables driver override by steering application
[in]brakeOverrideEnables driver override by brake application
[in]gearOverrideEnables driver override by brake application
[in]objA pointer to the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_sendASILCommand()

DW_API_PUBLIC dwStatus dwVehicleIO_sendASILCommand ( dwVehicleIOASILCommandE2EWrapper const *const  asilCmd,
dwVehicleIOHandle_t const  obj 
)

Send a vehicle command with ASIL rating to the VehicleIO.

@req{GID-AV_REQ-6875804}

Parameters
[in]asilCmdASIL command to be sent to the controller.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj or sensor handle are invalid
DW_INVALID_ARGUMENT - if the command contains an invalid element given IO state
DW_SUCCESS - if the message was sent successfully
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_sendCalibrationData()

DW_API_PUBLIC dwStatus dwVehicleIO_sendCalibrationData ( dwValSensorCalibration const *const  sensorCalibration,
dwVehicleIOHandle_t const  obj 
)

Send a vehicle sensor calibration to the VehicleIO.

Note that this function must be called before dwVehicleIO_sendASILCommand().

@req{GID-AV_REQ-6875807}

Parameters
[in]sensorCalibrationSensor calibration data to be sent to the controller.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj or sensor handle are invalid
DW_INVALID_ARGUMENT - if the command contains an invalid element given IO state
DW_SUCCESS - if the message was sent successfully
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_sendEgomotionData()

DW_API_PUBLIC dwStatus dwVehicleIO_sendEgomotionData ( dwValEgomotion const *const  egomotion,
dwVehicleIOHandle_t const  obj 
)

Send a vehicle egomotion data to the VehicleIO.

Note that this function must be called before dwVehicleIO_sendASILCommand().

@req{GID-AV_REQ-6875806}

Parameters
[in]egomotionEgomotion data to be sent to the controller.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj or sensor handle are invalid
DW_INVALID_ARGUMENT - if the command contains an invalid element given IO state
DW_SUCCESS - if the message was sent successfully
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_sendNonSafetyCommand()

DW_API_PUBLIC dwStatus dwVehicleIO_sendNonSafetyCommand ( const dwVehicleIONonSafetyCommand *const  nonSafeCmd,
dwVehicleIOHandle_t const  obj 
)

Send a vehicle non-safety command to the VehicleIO.

The non-safety command will be sent along with safety command. This API should be called before dwVehicleIO_sendSafetyCommand.

NOTE: This function will be deprecated in a future release. Please use use dwVehicleIO_sendASILCommand, dwVehicleIO_sendQMCommand, dwVehicleIO_sendEgomotionData or dwVehicleIO_sendCalibrationData instead.

Parameters
[in]nonSafeCmdNon-safety command to be sent to the controller.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj or sensor handle are invalid
DW_INVALID_ARGUMENT - if the command contains an invalid element given IO state DW_SUCCESS - if the message was sent successfully
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_sendQMCommand()

DW_API_PUBLIC dwStatus dwVehicleIO_sendQMCommand ( dwVehicleIOQMCommand const *const  qmCmd,
dwVehicleIOHandle_t const  obj 
)

Send a vehicle command with QM rating to the VehicleIO.

@req{GID-AV_REQ-6875805}

Parameters
[in]qmCmdQM command to be sent to the controller.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj or sensor handle are invalid
DW_INVALID_ARGUMENT - if the command contains an invalid element given IO state
DW_SUCCESS - if the message was sent successfully
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_sendSafetyCommand()

DW_API_PUBLIC dwStatus dwVehicleIO_sendSafetyCommand ( const dwVehicleIOSafetyCommand *const  safeCmd,
dwVehicleIOHandle_t const  obj 
)

Send a vehicle safety command to the VehicleIO.

NOTE: This function will be deprecated in a future release. Please use use dwVehicleIO_sendASILCommand, dwVehicleIO_sendQMCommand, dwVehicleIO_sendEgomotionData or dwVehicleIO_sendCalibrationData instead.

Parameters
[in]safeCmdSafety command to be sent to the controller.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj or sensor handle are invalid
DW_INVALID_ARGUMENT - if the command contains an invalid element given IO state DW_SUCCESS - if the message was sent successfully
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwVehicleIO_setDrivingMode()

DW_API_PUBLIC dwStatus dwVehicleIO_setDrivingMode ( dwVehicleIODrivingMode const  mode,
dwVehicleIOHandle_t const  obj 
)

Setting driving mode allows to control the behaviour of VehicleIO module with regards to the permitted commands and number of safety checks performed.

@req{GID-AV_REQ-6875812}

NOTE: Whether certain driving mode is actually supported and when/if it is taken into effect is highly dependent on the type of the actuation interface.

Use dwVehicleIO_getVehicleState call to determine which driving mode is in effect.

Use dwVehicleIO_getCapabilities call to determine which limits are supported when in DW_VEHICLEIO_DRIVING_LIMITED or DW_VEHICLEIO_DRIVING_LIMITED_ND modes.

Parameters
[in]modespecifies the mode of driving.
[in]objSpecifies the car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid DW_NOT_SUPPORTED - if the mode is not supported DW_SUCCESS - if the call was successful
See also
dwVehicleIODrivingMode
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes