DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

VehicleIO Actuators Interface

Detailed Description

Defines the APIs to access the VehicleIO car controller box.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwVehicleIOCapabilities
 VehicleIO Capabilities. More...
 
struct  dwVehicleIOCapabilityState
 The capability state data. More...
 
struct  dwVehicleIOCommand
 The command data. More...
 
struct  dwVehicleIOMiscCommand
 
struct  dwVehicleIOState
 The state data. More...
 

Modules

 VehicleIO Driver Interface
 Defines the VehicleIO Driver module for accessing a custom VehicleIO backend.
 

Macros

#define DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES   50
 

Typedefs

typedef struct dwVehicleIOObject * dwVehicleIOHandle_t
 

Enumerations

enum  dwVehicleIOAEBState {
  DW_VEHICLEIO_AEB_STATE_UNKNOWN = 0,
  DW_VEHICLEIO_AEB_STATE_OFF = 1,
  DW_VEHICLEIO_AEB_STATE_READY = 2
}
 
enum  dwVehicleIODoorLock {
  DW_VEHICLEIO_DOOR_UNKNOWN = 0,
  DW_VEHICLEIO_DOOR_UNLOCK = 1,
  DW_VEHICLEIO_DOOR_LOCK = 2
}
 
enum  dwVehicleIODrivingMode {
  DW_VEHICLEIO_DRIVING_LIMITED = 0x000,
  DW_VEHICLEIO_DRIVING_LIMITED_ND = 0x100,
  DW_VEHICLEIO_DRIVING_COLLISION_AVOIDANCE = 0x200,
  DW_VEHICLEIO_DRIVING_NO_SAFETY = 0x300
}
 
enum  dwVehicleIOFaults {
  DW_VEHICLEIO_FAULT_NONE = 0,
  DW_VEHICLEIO_FAULT_BRAKE = 1 << 0,
  DW_VEHICLEIO_FAULT_STEERING = 1 << 1,
  DW_VEHICLEIO_FAULT_THROTTLE = 1 << 2,
  DW_VEHICLEIO_FAULT_GEAR = 1 << 3,
  DW_VEHICLEIO_FAULT_SAFETY = 1 << 4
}
 
enum  dwVehicleIOFCWState {
  DW_VEHICLEIO_FCW_STATE_UNKNOWN = 0,
  DW_VEHICLEIO_FCW_STATE_OFF = 1,
  DW_VEHICLEIO_FCW_STATE_READY = 2
}
 
enum  dwVehicleIOGear {
  DW_VEHICLEIO_GEAR_UNKNOWN = 0,
  DW_VEHICLEIO_GEAR_PARK = 1,
  DW_VEHICLEIO_GEAR_REVERSE = 2,
  DW_VEHICLEIO_GEAR_NEUTRAL = 3,
  DW_VEHICLEIO_GEAR_DRIVE = 4,
  DW_VEHICLEIO_GEAR_LOW = 5,
  DW_VEHICLEIO_GEAR_MANUAL_REVERSE = 100,
  DW_VEHICLEIO_GEAR_1 = 101,
  DW_VEHICLEIO_GEAR_2 = 102,
  DW_VEHICLEIO_GEAR_3 = 103,
  DW_VEHICLEIO_GEAR_4 = 104,
  DW_VEHICLEIO_GEAR_5 = 105,
  DW_VEHICLEIO_GEAR_6 = 106,
  DW_VEHICLEIO_GEAR_7 = 107,
  DW_VEHICLEIO_GEAR_8 = 108,
  DW_VEHICLEIO_GEAR_9 = 109
}
 
enum  dwVehicleIOHeadlights {
  DW_VEHICLEIO_HEADLIGHTS_UNKNOWN = 0,
  DW_VEHICLEIO_HEADLIGHTS_OFF = 1,
  DW_VEHICLEIO_HEADLIGHTS_LOW_BEAM = 2,
  DW_VEHICLEIO_HEADLIGHTS_HIGH_BEAM = 3,
  DW_VEHICLEIO_HEADLIGHTS_DRL = 4
}
 
enum  dwVehicleIOMirror {
  DW_VEHICLEIO_MIRROR_UNKNOWN = 0,
  DW_VEHICLEIO_MIRROR_FOLD = 1,
  DW_VEHICLEIO_MIRROR_UNFOLD = 2,
  DW_VEHICLEIO_MIRROR_ADJUST_LEFT = 3,
  DW_VEHICLEIO_MIRROR_ADJUST_RIGHT = 4
}
 
enum  dwVehicleIOMoonroof {
  DW_VEHICLEIO_MOONROOF_UNKNOWN = 0,
  DW_VEHICLEIO_MOONROOF_CLOSE = 1,
  DW_VEHICLEIO_MOONROOF_OPEN = 2
}
 
enum  dwVehicleIOOverrides {
  DW_VEHICLEIO_OVERRIDE_NONE = 0,
  DW_VEHICLEIO_OVERRIDE_BRAKE = 1 << 0,
  DW_VEHICLEIO_OVERRIDE_STEERING = 1 << 1,
  DW_VEHICLEIO_OVERRIDE_THROTTLE = 1 << 2,
  DW_VEHICLEIO_OVERRIDE_GEAR = 1 << 3
}
 
enum  dwVehicleIOTurnSignal {
  DW_VEHICLEIO_TURNSIGNAL_UNKNOWN = 0,
  DW_VEHICLEIO_TURNSIGNAL_OFF = 1,
  DW_VEHICLEIO_TURNSIGNAL_LEFT = 2,
  DW_VEHICLEIO_TURNSIGNAL_RIGHT = 3,
  DW_VEHICLEIO_TURNSIGNAL_EMERGENCY = 4
}
 
enum  dwVehicleIOType {
  DW_VEHICLEIO_DATASPEED = 0,
  DW_VEHICLEIO_GENERIC = 1,
  DW_VEHICLEIO_SPACEDRIVE = 2,
  DW_VEHICLEIO_STARDRIVE = 3,
  DW_VEHICLEIO_CUSTOM = 4,
  DW_VEHICLEIO_AUDIHYPERION = 5,
  DW_VEHICLEIO_DRIVER_COUNT = 6
}
 

Functions

DW_API_PUBLIC dwStatus dwVehicleIO_addCANSensor (uint32_t vehicleIOId, dwSensorHandle_t sensorHandle, dwVehicleIOHandle_t obj)
 Add CAN sensor handle and corresponding VehicleIO configuration ID. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_consumeCANFrame (const dwCANMessage *msg, uint32_t sensorId, dwVehicleIOHandle_t obj)
 Parse a received event. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getCapabilities (dwVehicleIOCapabilities *caps, dwVehicleIOHandle_t obj)
 Retrieve current VehicleIO capabilities. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleState (dwVehicleIOState *state, dwVehicleIOHandle_t obj)
 Retrieve current vehicle state. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_initialize (dwVehicleIOHandle_t *obj, dwVehicleIOType type, const dwVehicle *properties, dwContextHandle_t ctx)
 Initialize VehicleIO and prepare all internal structures. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_initializeFromDBC (dwVehicleIOHandle_t *obj, dwVehicleIOType type, const dwVehicle *properties, const char *dbcFilePath, dwContextHandle_t ctx)
 Initialize VehicleIO and prepare all internal structures from DBC File. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_initializeFromRig (dwVehicleIOHandle_t *obj, dwRigHandle_t rig, dwContextHandle_t ctx)
 Initialize VehicleIO and prepare all internal structures from Rig Configuration. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_release (dwVehicleIOHandle_t obj)
 Release used memory and close all modules. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_reset (dwVehicleIOHandle_t obj)
 Reset VehicleIO to default state. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_selectDriverOverrides (bool throttleOverride, bool steeringOverride, bool brakeOverride, bool gearOverride, dwVehicleIOHandle_t obj)
 Select the overrides that the driver can use to disable vehicle control. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendCommand (const dwVehicleIOCommand *cmd, dwVehicleIOHandle_t obj)
 Send a vehicle command to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_sendMiscCommand (const dwVehicleIOMiscCommand *cmd, dwVehicleIOHandle_t obj)
 Send a vehicle command to the VehicleIO. More...
 
DW_API_PUBLIC dwStatus dwVehicleIO_setDrivingMode (dwVehicleIODrivingMode mode, dwVehicleIOHandle_t 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...
 

Data Structure Documentation

◆ dwVehicleIOCapabilities

struct dwVehicleIOCapabilities
Data Fields
float32_t brakeValueLUT[DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES] Lookup Table indexed by speed (m/s), i.e. LUT[i] is the capability value at speed = i m/s.
int32_t brakeValueLUTSize Size of the corresponding lookup table.
float32_t reverseSpeedLimit Normally a negative value (m/s)
float32_t steeringSpeedLUT[DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES] Lookup Table indexed by speed (m/s), i.e. LUT[i] is the capability value at speed = i m/s.
int32_t steeringSpeedLUTSize Size of the corresponding lookup table.
float32_t steeringWheelAngleLUT[DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES] Lookup Table indexed by speed (m/s), i.e. LUT[i] is the capability value at speed = i m/s.
int32_t steeringWheelAngleLUTSize Size of the corresponding lookup table.
float32_t throttleValueLUT[DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES] Lookup Table indexed by speed (m/s), i.e. LUT[i] is the capability value at speed = i m/s.
int32_t throttleValueLUTSize Size of the corresponding lookup table.

◆ dwVehicleIOCapabilityState

struct dwVehicleIOCapabilityState
Data Fields
float32_t longVelocityForwardMax A maximum positive longitudinal vehicle speed that the vehicle is designed for.
dwTime_t longVelocityForwardMaxTimestamp
float32_t longVelocityForwardMin A minimum positive longitudinal vehicle speed, when driving forward, to avoid burning the clutch.
dwTime_t longVelocityForwardMinTimestamp
dwTime_t rearAxleCurvatureCapabilityTimestamp
float32_t rearAxleCurvatureMax The tightest radius (left) that can be guaranteed.
float32_t rearAxleCurvatureMin The tightest radius (right) that can be guaranteed.

◆ dwVehicleIOCommand

struct dwVehicleIOCommand
Data Fields
bool accelerationValid True if setting acceleration.
float32_t accelerationValue acceleration m/s^2
bool aebRequest Request to activate AEB.
dwVehicleIOAEBState aebState AEB system status/state.
bool brakeValid True if setting break.
float32_t brakeValue range 0.0 to 1.0
bool clearFaults Setting > 0 clears any canbus faults/errors.
bool decelerationValid True if setting deceleration.
float32_t decelerationValue decleration m/s^2 - represented as a positive number
bool enable True if we are driving by wire. Has to always be set.
bool fcwRequest Request to activate FCW.
dwVehicleIOFCWState fcwState FCW system status/state.
dwVehicleIOGear gear Desired gear: 0=UNKNOWN, 1=PARK, 2=REVERSE, 3=NEUTRAL, 4=DRIVE.
bool gearValid True if setting gear.
uint64_t heartbeatCounter VIO command heartbeat.
bool rearAxleCurvatureValid True if setting rear axle curvature.
float32_t rearAxleCurvatureValue Path curvature request based on travelled distance (1/m)
bool speedValid True if setting speed.
float32_t steeringSpeed Desired speed of the turning command rad/s.
bool steeringValid True if setting steering.
float32_t steeringWheelAngle Desired steering wheel angle (rad)
bool throttleValid True if setting throttle.
float32_t throttleValue range 0.0 to 1.0
dwVehicleIOTurnSignal turnSig Turn signal value.
bool turnSigValid True if setting turn signal.

◆ dwVehicleIOMiscCommand

struct dwVehicleIOMiscCommand
Data Fields
bool clearFaults
bool displayBrightnessValid True if setting display brightness.
uint8_t displayBrightnessValue
dwVehicleIODoorLock doorLock basic lock or unlock
bool doorLockValid True if setting door locks.
bool enable
dwVehicleIOHeadlights headlights ON/OFF, LOW_BEAM, HIGH_BEAM, DRL.
bool headlightsValid True if setting headlights.
bool mirrorAdjustValid True if setting mirror adjustment.
float32_t mirrorAdjustX float value 0-5.0 seconds
float32_t mirrorAdjustY float value 0-5.0 seconds
bool mirrorFoldValid True if setting mirror un/fold.
dwVehicleIOMirror mirrors FOLD, UNFOLD, ADJUST_LEFT, ADJUST_RIGHT.
dwVehicleIOMoonroof moonroof basic open or close
bool moonroofValid True if setting moonroof movement.
dwVehicleIOTurnSignal turnSig Turn signal - misc also wants this.
bool turnSigValid True if setting turn signal.

◆ dwVehicleIOState

struct dwVehicleIOState
Data Fields
dwVector2f acceleration Actual acceleration measured in m/s^2.
dwTime_t accelerationTimestamp Time at which acceleration was updated.
float32_t brakeCmd Last acknowledged brake value from a command (0..1 +- 0.01 fraction of max pedal depressed, unitless)
bool brakeEnabled Brake by-wire enablement reported by vehicle.
float32_t brakeState Brake value in effect (0..1 +- 0.01 fraction of max pedal depressed, unitless)
dwTime_t brakeTimestamp Time at which brake was updated.
float32_t brakeTorqueActual Actual applied brake torque value (Nm)
float32_t brakeTorqueRequested Requested value of brake torque (Nm)
float32_t brakeValue Current brake value as requested by a driver (0..1 +- 0.01 fraction of max pedal depressed, unitless)
bool buckleDriver
bool bucklePassenger
bool buttonCruiseControlCancel
bool buttonCruiseControlDecrement
bool buttonCruiseControlGapDecrement
bool buttonCruiseControlGapIncrement
bool buttonCruiseControlIncrement
bool buttonCruiseControlOnOff
bool buttonCruiseControlReset
bool buttonCruiseControlResetCancel
bool buttonLaneAssistOnOff
bool buttonLeftKeypadDown
bool buttonLeftKeypadOk
bool buttonLeftKeypadUp
dwVehicleIOCapabilityState capability
bool doorDriver
bool doorHood
bool doorPassenger
bool doorRearLeft
bool doorRearRight
bool doorTrunk
dwVehicleIODrivingMode drivingMode
bool enabled
dwVehicleIOFaults faults Faults detected (0 = none)
float32_t fuelLevel (0 to 1 +- 0.01 fraction of tank volume, unitless)
dwVehicleIOGear gear Vehicle gear.
dwVehicleIOGear gearCmd Last acknowledged gear from a command.
bool highBeamHeadlights
float32_t inverseSteeringR Inverse turning radius of the vehicle on the road.

The radius depends on the vehicle wheel base, steering wheel angle, drivetrain properties and current speed.

dwVehicleIOOverrides overrides Overrides in place (0 = none)
bool passengerAirbag
bool passengerDetect
dwVector2f radarVelocity Reported velocity from radar unit(s)
dwTime_t radarVelocityTimestamp
float32_t rearAxleCurvature Path curvature [1/m].
dwTime_t rearAxleCurvatureTimestamp Timestamp for all motion signals.
float32_t speed Signed norm of velocity vector.
dwTime_t speedTimestamp Time at which speed was updated.
float32_t steeringAngle Same as inverseSteeringR described as an angle instead of radius [rad].
float32_t steeringCmd Last acknowledged steering value from a command (-10.0 to 10.0 +- 0.01rad)
bool steeringEnabled Steering by-wire enablement reported by vehicle.
dwTime_t steeringTimestamp Time at which steering was updated.
float32_t steeringWheelAngle Steering wheel angle (-10.0 to 10.0 +- 0.01rad)
float32_t steeringWheelTorque Steering wheel torque (0 to 10.0 +- 0.01 Nm)
float32_t suspension[DW_VEHICLE_NUM_WHEELS] Vehicle Suspension data.
float32_t throttleCmd Last acknowledged throttle value from a command (0..1 +- 0.01 fraction of max pedal depressed, unitless)
bool throttleEnabled Throttle by-wire enablement reported by vehicle.
float32_t throttleState Throttle value in effect (0..1 +- 0.01 fraction of max pedal depressed, unitless)
dwTime_t throttleTimestamp Time at which throttle was updated.
float32_t throttleValue Current thottle value as requested by a driver (0..1 +- 0.01 fraction of max pedal depressed, unitless)
float32_t tirePressure[DW_VEHICLE_NUM_WHEELS] Vehicle tire pressure data.
dwVehicleIOTurnSignal turnSignal Turn signal value.
dwVector2f velocity Vehicle velocity (longitudinal, lateral) measured in m/s at the rear axle.
int16_t wheelPosition[DW_VEHICLE_NUM_WHEELS] Vehicle Wheel Position counters.

The counters are subject to roll-over. Actual wheel travel distance depends on wheel radius, which requires calibration.

dwTime_t wheelPositionTimestamp[DW_VEHICLE_NUM_WHEELS] individual timestamps of wheel position readings
float32_t wheelSpeed[DW_VEHICLE_NUM_WHEELS] vehicle individual wheel speeds (rad/s)
dwTime_t wheelSpeedTimestamp[DW_VEHICLE_NUM_WHEELS] vehicle individual timestamps of wheel speeds readings
bool wiper

Macro Definition Documentation

◆ DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES

#define DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES   50

Definition at line 383 of file VehicleIO.h.

Typedef Documentation

◆ dwVehicleIOHandle_t

typedef struct dwVehicleIOObject* dwVehicleIOHandle_t

Definition at line 65 of file VehicleIO.h.

Enumeration Type Documentation

◆ dwVehicleIOAEBState

Enumerator
DW_VEHICLEIO_AEB_STATE_UNKNOWN 
DW_VEHICLEIO_AEB_STATE_OFF 
DW_VEHICLEIO_AEB_STATE_READY 

Definition at line 172 of file VehicleIO.h.

◆ dwVehicleIODoorLock

Enumerator
DW_VEHICLEIO_DOOR_UNKNOWN 
DW_VEHICLEIO_DOOR_UNLOCK 
DW_VEHICLEIO_DOOR_LOCK 

Definition at line 143 of file VehicleIO.h.

◆ dwVehicleIODrivingMode

Enumerator
DW_VEHICLEIO_DRIVING_LIMITED 

Comfortable driving is expected (most conservative).

Commands that leave the comfort zone are treated as unsafe, which immediately leads to VehicleIO being disabled.

DW_VEHICLEIO_DRIVING_LIMITED_ND 

Same as above, but unsafe commands are clamped to safe limits and warnings are isssued.

VehicleIO stays enabled.

DW_VEHICLEIO_DRIVING_COLLISION_AVOIDANCE 

Safety checks suitable for collision avoidance logic (right now same as NO_SAFETY below).

DW_VEHICLEIO_DRIVING_NO_SAFETY 

VehicleIO will bypass all safety checks.

Definition at line 67 of file VehicleIO.h.

◆ dwVehicleIOFaults

Enumerator
DW_VEHICLEIO_FAULT_NONE 
DW_VEHICLEIO_FAULT_BRAKE 
DW_VEHICLEIO_FAULT_STEERING 
DW_VEHICLEIO_FAULT_THROTTLE 
DW_VEHICLEIO_FAULT_GEAR 
DW_VEHICLEIO_FAULT_SAFETY 

Definition at line 95 of file VehicleIO.h.

◆ dwVehicleIOFCWState

Enumerator
DW_VEHICLEIO_FCW_STATE_UNKNOWN 
DW_VEHICLEIO_FCW_STATE_OFF 
DW_VEHICLEIO_FCW_STATE_READY 

Definition at line 179 of file VehicleIO.h.

◆ dwVehicleIOGear

Enumerator
DW_VEHICLEIO_GEAR_UNKNOWN 
DW_VEHICLEIO_GEAR_PARK 
DW_VEHICLEIO_GEAR_REVERSE 
DW_VEHICLEIO_GEAR_NEUTRAL 
DW_VEHICLEIO_GEAR_DRIVE 
DW_VEHICLEIO_GEAR_LOW 
DW_VEHICLEIO_GEAR_MANUAL_REVERSE 
DW_VEHICLEIO_GEAR_1 
DW_VEHICLEIO_GEAR_2 
DW_VEHICLEIO_GEAR_3 
DW_VEHICLEIO_GEAR_4 
DW_VEHICLEIO_GEAR_5 
DW_VEHICLEIO_GEAR_6 
DW_VEHICLEIO_GEAR_7 
DW_VEHICLEIO_GEAR_8 
DW_VEHICLEIO_GEAR_9 

Definition at line 112 of file VehicleIO.h.

◆ dwVehicleIOHeadlights

Enumerator
DW_VEHICLEIO_HEADLIGHTS_UNKNOWN 
DW_VEHICLEIO_HEADLIGHTS_OFF 
DW_VEHICLEIO_HEADLIGHTS_LOW_BEAM 
DW_VEHICLEIO_HEADLIGHTS_HIGH_BEAM 
DW_VEHICLEIO_HEADLIGHTS_DRL 

Definition at line 163 of file VehicleIO.h.

◆ dwVehicleIOMirror

Enumerator
DW_VEHICLEIO_MIRROR_UNKNOWN 
DW_VEHICLEIO_MIRROR_FOLD 
DW_VEHICLEIO_MIRROR_UNFOLD 
DW_VEHICLEIO_MIRROR_ADJUST_LEFT 
DW_VEHICLEIO_MIRROR_ADJUST_RIGHT 

Definition at line 155 of file VehicleIO.h.

◆ dwVehicleIOMoonroof

Enumerator
DW_VEHICLEIO_MOONROOF_UNKNOWN 
DW_VEHICLEIO_MOONROOF_CLOSE 
DW_VEHICLEIO_MOONROOF_OPEN 

Definition at line 149 of file VehicleIO.h.

◆ dwVehicleIOOverrides

Enumerator
DW_VEHICLEIO_OVERRIDE_NONE 
DW_VEHICLEIO_OVERRIDE_BRAKE 
DW_VEHICLEIO_OVERRIDE_STEERING 
DW_VEHICLEIO_OVERRIDE_THROTTLE 
DW_VEHICLEIO_OVERRIDE_GEAR 

Definition at line 104 of file VehicleIO.h.

◆ dwVehicleIOTurnSignal

Enumerator
DW_VEHICLEIO_TURNSIGNAL_UNKNOWN 
DW_VEHICLEIO_TURNSIGNAL_OFF 
DW_VEHICLEIO_TURNSIGNAL_LEFT 
DW_VEHICLEIO_TURNSIGNAL_RIGHT 
DW_VEHICLEIO_TURNSIGNAL_EMERGENCY 

Definition at line 135 of file VehicleIO.h.

◆ dwVehicleIOType

Enumerator
DW_VEHICLEIO_DATASPEED 
DW_VEHICLEIO_GENERIC 
DW_VEHICLEIO_SPACEDRIVE 
DW_VEHICLEIO_STARDRIVE 
DW_VEHICLEIO_CUSTOM 
DW_VEHICLEIO_AUDIHYPERION 
DW_VEHICLEIO_DRIVER_COUNT 

Definition at line 85 of file VehicleIO.h.

Function Documentation

◆ dwVehicleIO_addCANSensor()

DW_API_PUBLIC dwStatus dwVehicleIO_addCANSensor ( uint32_t  vehicleIOId,
dwSensorHandle_t  sensorHandle,
dwVehicleIOHandle_t  obj 
)

Add CAN sensor handle and corresponding VehicleIO configuration ID.

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

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

◆ dwVehicleIO_consumeCANFrame()

DW_API_PUBLIC dwStatus dwVehicleIO_consumeCANFrame ( const dwCANMessage msg,
uint32_t  sensorId,
dwVehicleIOHandle_t  obj 
)

Parse a received event.

A parsed messages will generate certain reports, which can be gathered using the according callbacks. A sensor ID not corresponding to the incoming message may cause incorrect behavior. For manual VehicleIO initialization with single can BUS, a sensor ID of 0 is expected.

Parameters
[in]msgCAN message to be parsed by the controller.
[in]sensorIdSpecifies index of CAN 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 msg is null
DW_SUCCESS - if the initialization is successful

◆ dwVehicleIO_getCapabilities()

DW_API_PUBLIC dwStatus dwVehicleIO_getCapabilities ( dwVehicleIOCapabilities caps,
dwVehicleIOHandle_t  obj 
)

Retrieve current VehicleIO capabilities.

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

◆ dwVehicleIO_getVehicleState()

DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleState ( dwVehicleIOState state,
dwVehicleIOHandle_t  obj 
)

Retrieve current vehicle 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.

Parameters
[out]statereturned vehicle 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

◆ dwVehicleIO_initialize()

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

Initialize VehicleIO and prepare all internal structures.

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

◆ dwVehicleIO_initializeFromDBC()

DW_API_PUBLIC dwStatus dwVehicleIO_initializeFromDBC ( dwVehicleIOHandle_t obj,
dwVehicleIOType  type,
const dwVehicle properties,
const char *  dbcFilePath,
dwContextHandle_t  ctx 
)

Initialize VehicleIO and prepare all internal structures from DBC File.

Parameters
[out]objA pointer to the car controller handle for the created module.
[in]typeSpecifies the VehicleIO controller type.
[in]propertiesSpecified Vehicle properties (from rig.json)
[in]dbcFilePathSpeficifes path to the dbc file for initializing a DBC-based canbus interpreter
[in]ctxSpecifies the handler to the DriveWorks context.
Returns
DW_INVALID_ARGUMENT - if any of the given arguments are not valid
DW_SUCCESS - if the initialization is successful

◆ dwVehicleIO_initializeFromRig()

DW_API_PUBLIC dwStatus dwVehicleIO_initializeFromRig ( dwVehicleIOHandle_t obj,
dwRigHandle_t  rig,
dwContextHandle_t  ctx 
)

Initialize VehicleIO and prepare all internal structures from Rig Configuration.

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

◆ dwVehicleIO_release()

DW_API_PUBLIC dwStatus dwVehicleIO_release ( dwVehicleIOHandle_t  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.

Parameters
[in]objThe car controller module handle.
Returns
DW_INVALID_HANDLE - if given obj handle is invalid
DW_SUCCESS - if the initialization is successful

◆ dwVehicleIO_reset()

DW_API_PUBLIC dwStatus dwVehicleIO_reset ( dwVehicleIOHandle_t  obj)

Reset VehicleIO to default state.

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.

◆ dwVehicleIO_selectDriverOverrides()

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

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

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

◆ dwVehicleIO_sendCommand()

DW_API_PUBLIC dwStatus dwVehicleIO_sendCommand ( const dwVehicleIOCommand cmd,
dwVehicleIOHandle_t  obj 
)

Send a vehicle command to the VehicleIO.

Parameters
[in]cmdCommand 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

◆ dwVehicleIO_sendMiscCommand()

DW_API_PUBLIC dwStatus dwVehicleIO_sendMiscCommand ( const dwVehicleIOMiscCommand cmd,
dwVehicleIOHandle_t  obj 
)

Send a vehicle command to the VehicleIO.

Parameters
[in]cmdCommand 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 initialization is successful

◆ dwVehicleIO_setDrivingMode()

DW_API_PUBLIC dwStatus dwVehicleIO_setDrivingMode ( dwVehicleIODrivingMode  mode,
dwVehicleIOHandle_t  obj 
)

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

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_SUCCESS - if the call was successful
See also
dwVehicleIODrivingMode