Defines the APIs to access the VehicleIO car controller box.
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 |
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... | |
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. |
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. |
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. |
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. |
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 |
#define DW_VEHICLEIO_SPEED_LUT_MAX_ENTRIES 50 |
Definition at line 383 of file VehicleIO.h.
typedef struct dwVehicleIOObject* dwVehicleIOHandle_t |
Definition at line 65 of file VehicleIO.h.
enum 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.
enum dwVehicleIODoorLock |
Enumerator | |
---|---|
DW_VEHICLEIO_DOOR_UNKNOWN | |
DW_VEHICLEIO_DOOR_UNLOCK | |
DW_VEHICLEIO_DOOR_LOCK |
Definition at line 143 of file VehicleIO.h.
Definition at line 67 of file VehicleIO.h.
enum 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.
enum 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.
enum dwVehicleIOGear |
Definition at line 112 of file VehicleIO.h.
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.
enum 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.
enum dwVehicleIOMoonroof |
Enumerator | |
---|---|
DW_VEHICLEIO_MOONROOF_UNKNOWN | |
DW_VEHICLEIO_MOONROOF_CLOSE | |
DW_VEHICLEIO_MOONROOF_OPEN |
Definition at line 149 of file VehicleIO.h.
enum 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.
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.
enum 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.
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.
[in] | vehicleIOId | Specifies ID of vehicle IO configuration. |
[in] | sensorHandle | Specifies the underlying VehicleIO CAN sensor. |
[in] | obj | Specifies the car controller module handle. |
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.
[in] | msg | CAN message to be parsed by the controller. |
[in] | sensorId | Specifies index of CAN sensor that message came from. |
[in] | obj | Specifies the car controller module handle. |
DW_API_PUBLIC dwStatus dwVehicleIO_getCapabilities | ( | dwVehicleIOCapabilities * | caps, |
dwVehicleIOHandle_t | obj | ||
) |
Retrieve current VehicleIO capabilities.
[out] | caps | returned VehicleIO capabilities. |
[in] | obj | Specifies the car controller module handle. |
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.
[out] | state | returned vehicle state. |
[in] | obj | Specifies the car controller module handle. |
DW_API_PUBLIC dwStatus dwVehicleIO_initialize | ( | dwVehicleIOHandle_t * | obj, |
dwVehicleIOType | type, | ||
const dwVehicle * | properties, | ||
dwContextHandle_t | ctx | ||
) |
Initialize VehicleIO and prepare all internal structures.
[out] | obj | A pointer to the car controller handle for the created module. |
[in] | type | Specifies the VehicleIO controller type. |
[in] | properties | Vehicle properties as described by dwRig module. |
[in] | ctx | Specifies the handler to the DriveWorks context. |
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.
[out] | obj | A pointer to the car controller handle for the created module. |
[in] | type | Specifies the VehicleIO controller type. |
[in] | properties | Specified Vehicle properties (from rig.json) |
[in] | dbcFilePath | Speficifes path to the dbc file for initializing a DBC-based canbus interpreter |
[in] | ctx | Specifies the handler to the DriveWorks context. |
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.
[out] | obj | A pointer to the car controller handle for the created module. |
[in] | rig | Specifies the handler to the Rig Configuration. |
[in] | ctx | Specifies the handler to the DriveWorks context. |
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.
[in] | obj | The car controller module handle. |
DW_API_PUBLIC dwStatus dwVehicleIO_reset | ( | dwVehicleIOHandle_t | obj | ) |
Reset VehicleIO to default state.
[in] | obj | Specifies the car controller module handle. |
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.
[in] | throttleOverride | Enables driver override by throttle application |
[in] | steeringOverride | Enables driver override by steering application |
[in] | brakeOverride | Enables driver override by brake application |
[in] | gearOverride | Enables driver override by brake application |
[in] | obj | A pointer to the car controller module handle. |
DW_API_PUBLIC dwStatus dwVehicleIO_sendCommand | ( | const dwVehicleIOCommand * | cmd, |
dwVehicleIOHandle_t | obj | ||
) |
Send a vehicle command to the VehicleIO.
[in] | cmd | Command to be sent to the controller. |
[in] | obj | Specifies the car controller module handle. |
DW_API_PUBLIC dwStatus dwVehicleIO_sendMiscCommand | ( | const dwVehicleIOMiscCommand * | cmd, |
dwVehicleIOHandle_t | obj | ||
) |
Send a vehicle command to the VehicleIO.
[in] | cmd | Command to be sent to the controller. |
[in] | obj | Specifies the car controller module handle. |
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.
[in] | mode | specifies the mode of driving. |
[in] | obj | Specifies the car controller module handle. |