|
|
DriveWorks SDK Reference| 0.6.67 Release |
API of to access VehicleIO car controller box.
Data Structures | |
| struct | dwVehicleIOCommand |
| The command data. More... | |
| struct | dwVehicleIOState |
| The state data. More... | |
Typedefs | |
| typedef struct dwVehicleIOObject * | dwVehicleIOHandle_t |
| struct dwVehicleIOCommand |
| Data Fields | ||
|---|---|---|
| dwBool | brakePercent | if true, value is in percent, otherwise direct pedal position |
| float32_t | brakeTorque | torque value in Nm |
| dwBool | brakeValid | True if setting break. |
| float32_t | brakeValue | range 0.0 to 1.0 |
| dwBool | clearFaults | Setting > 0 clears any canbus faults/errors. |
| dwBool | enable | True if we are driving by wire. Has to always be set. |
| dwVehicleIOGear | gear | Desired gear: 0=UNKNOWN, 1=PARK, 2=REVERSE, 3=NEUTRAL, 4=DRIVE. |
| dwBool | gearValid | True if setting gear. |
| dwBool | speedValid | True if setting speed. |
| float32_t | steering | Desired steering wheel angle (rad) |
| float32_t | steeringSpeed | Desired speed of the turning command rad/s. |
| dwBool | steeringValid | True if setting steering. |
| dwBool | throttlePercent | if true, value is in percent, otherwise direct pedal position |
| dwBool | throttleValid | True if setting throttle. |
| float32_t | throttleValue | range 0.0 to 1.0 |
| dwVehicleIOTurnSignal | turnSig | Turn signal value. |
| dwBool | turnSigValid | True if setting turn signal. |
| struct dwVehicleIOState |
| Data Fields | ||
|---|---|---|
| float32_t | brakeCmd | Last acknowledged brake value from a command (0..1 ± 0.01 fraction of max pedal depressed, unitless) |
| float32_t | brakeTorqueActual | Actual applied brake torque value (Nm) |
| float32_t | brakeTorqueRequested | Requested value of brake torque (Nm) |
| float32_t | brakeValue | Current brake value (0..1 ± 0.01 fraction of max pedal depressed, unitless) |
| dwBool | buckleDriver | |
| dwBool | bucklePassenger | |
| dwBool | buttonCruiseControlCancel | |
| dwBool | buttonCruiseControlDecrement | |
| dwBool | buttonCruiseControlGapDecrement | |
| dwBool | buttonCruiseControlGapIncrement | |
| dwBool | buttonCruiseControlIncrement | |
| dwBool | buttonCruiseControlOnOff | |
| dwBool | buttonCruiseControlReset | |
| dwBool | buttonCruiseControlResetCancel | |
| dwBool | buttonLaneAssistOnOff | |
| dwBool | doorDriver | |
| dwBool | doorHood | |
| dwBool | doorPassenger | |
| dwBool | doorRearLeft | |
| dwBool | doorRearRight | |
| dwBool | doorTrunk | |
| dwVehicleIODrivingMode | drivingMode | |
| dwBool | 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. |
| dwBool | 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) |
| dwBool | passengerAirbag | |
| dwBool | passengerDetect | |
| float32_t | speed | Vehicle speed (-100 to 100 m/s ± 0.02m/s) |
| 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 | 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) |
| float32_t | throttleValue | Current thottle value (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. |
| float32_t | wheelSpeed[DW_VEHICLE_NUM_WHEELS] | vehicle individual wheel speeds (m/s) |
| dwBool | wiper | |
| typedef struct dwVehicleIOObject* dwVehicleIOHandle_t |
Definition at line 62 of file VehicleIO.h.
Definition at line 64 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 87 of file VehicleIO.h.
| enum dwVehicleIOGear |
Definition at line 104 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 96 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 127 of file VehicleIO.h.
| enum dwVehicleIOType |
| Enumerator | |
|---|---|
| DW_VEHICLEIO_DATASPEED | |
| DW_VEHICLEIO_GENERIC | |
Definition at line 82 of file VehicleIO.h.
| enum dwVehicleIOWheels |
Define index for each of the wheels on a 4 wheel vehicle.
These indices are to be used to point into dwVehicleIOState.
| Enumerator | |
|---|---|
| DW_VEHICLEIO_WHEELS_FRONT_LEFT | |
| DW_VEHICLEIO_WHEELS_FRONT_RIGHT | |
| DW_VEHICLEIO_WHEELS_REAR_LEFT | |
| DW_VEHICLEIO_WHEELS_REAR_RIGHT | |
| DW_VEHICLE_NUM_WHEELS | |
Definition at line 179 of file VehicleIO.h.
| DW_API_PUBLIC dwStatus dwVehicleIO_consume | ( | const dwCANMessage * | msg, |
| dwVehicleIOHandle_t | obj | ||
| ) |
Parse a received CAN message.
A parsed messages will generate certain reports, which can be gathered using the according callbacks.
| [in] | msg | CAN message to be parsed by the controller. |
| [in] | obj | Specifies the car controler 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 dwRigConfiguration module. |
| [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 | A pointer to 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 | ( | dwBool | throttleOverride, |
| dwBool | steeringOverride, | ||
| dwBool | brakeOverride, | ||
| dwBool | 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_sendVehicleCommand | ( | const dwVehicleIOCommand * | cmd, |
| dwSensorHandle_t | hsensor, | ||
| dwVehicleIOHandle_t | obj | ||
| ) |
Send a vehicle command to the VehicleIO.
| [in] | cmd | Command to be sent to the controller. |
| [in] | hsensor | Specifies the underlying VehicleIO sensor (e.g. CAN). |
| [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. |