DriveWorks SDK Reference

| 0.6.67 Release

VehicleIO.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2015-2017 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
45 #ifndef DW_VEHICLEIO_H__
46 #define DW_VEHICLEIO_H__
47 
48 #include <dw/core/Config.h>
49 #include <dw/core/Exports.h>
50 #include <dw/core/Context.h>
51 #include <dw/core/Types.h>
52 #include <dw/sensors/Sensors.h>
53 #include <dw/sensors/canbus/CAN.h>
55 
56 #include <stdint.h>
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 typedef struct dwVehicleIOObject *dwVehicleIOHandle_t;
63 
64 typedef enum dwVehicleIODrivingMode {
69 
73 
77 
81 
82 typedef enum{
86 
87 typedef enum {
95 
96 typedef enum {
103 
104 typedef enum {
106 
107  // Automatic vehicles
113 
114  // Stick shift vehicles
126 
127 typedef enum{
129 
135 
139 typedef struct dwVehicleIOCommand {
140 
142 
143  // Steering command
146 
147  // Throttle command
150 
151  // Brake command
155 
156  // Other commands
159 
160  // Clear CAN bus errors
162 
163  // Booleans validating commands
170 
172 
173 
179 typedef enum dwVehicleIOWheels
180 {
185 
186 
189 
190 
194 typedef struct dwVehicleIOState {
195 
198 
201 
203  float32_t steeringAngle;
206 
213 
217 
218  // Vehicle Miscellanoeus data
240 
245 
248 
250 
253 
267 dwStatus dwVehicleIO_initialize(dwVehicleIOHandle_t *obj, dwVehicleIOType type, const dwVehicle* properties,
268  dwContextHandle_t ctx);
269 
280 dwStatus dwVehicleIO_reset(dwVehicleIOHandle_t obj);
281 
292 dwStatus dwVehicleIO_release(dwVehicleIOHandle_t *obj);
293 
307 dwStatus dwVehicleIO_selectDriverOverrides(dwBool throttleOverride, dwBool steeringOverride, dwBool brakeOverride, dwBool gearOverride, dwVehicleIOHandle_t obj);
308 
321 dwStatus dwVehicleIO_consume(const dwCANMessage *msg, dwVehicleIOHandle_t obj);
322 
335  dwSensorHandle_t hsensor,
336  dwVehicleIOHandle_t obj);
337 
349 dwStatus dwVehicleIO_getVehicleState(dwVehicleIOState *state, dwVehicleIOHandle_t obj);
350 
364 dwStatus dwVehicleIO_setDrivingMode(dwVehicleIODrivingMode mode, dwVehicleIOHandle_t obj);
365 
366 #ifdef __cplusplus
367 }
368 #endif
369 
370 #endif // DW_VehicleIO_ACTUATORS_H__
dwVehicleIOWheels
Define index for each of the wheels on a 4 wheel vehicle.
Definition: VehicleIO.h:179
dwBool buttonCruiseControlGapDecrement
Definition: VehicleIO.h:226
dwBool doorRearRight
Definition: VehicleIO.h:231
NVIDIA DriveWorks API: Rig Configuration
dwBool turnSigValid
True if setting turn signal.
Definition: VehicleIO.h:169
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 permitte...
dwBool bucklePassenger
Definition: VehicleIO.h:237
NVIDIA DriveWorks API: Core Types
dwVehicleIOGear
Definition: VehicleIO.h:104
float float32_t
Specifies POD types.
Definition: Types.h:77
The state data.
Definition: VehicleIO.h:194
dwVehicleIODrivingMode drivingMode
Definition: VehicleIO.h:249
dwVehicleIOTurnSignal
Definition: VehicleIO.h:127
float32_t throttleValue
Current thottle value (0..1 ± 0.01 fraction of max pedal depressed, unitless)
Definition: VehicleIO.h:207
dwBool doorDriver
Definition: VehicleIO.h:228
dwBool highBeamHeadlights
Definition: VehicleIO.h:238
dwBool buttonCruiseControlReset
Definition: VehicleIO.h:220
dwBool brakeValid
True if setting break.
Definition: VehicleIO.h:165
The command data.
Definition: VehicleIO.h:139
dwBool throttleValid
True if setting throttle.
Definition: VehicleIO.h:164
dwVehicleIOFaults faults
Faults detected (0 = none)
Definition: VehicleIO.h:247
float32_t brakeCmd
Last acknowledged brake value from a command (0..1 ± 0.01 fraction of max pedal depressed, unitless)
Definition: VehicleIO.h:210
float32_t speed
Vehicle speed (-100 to 100 m/s ± 0.02m/s)
Definition: VehicleIO.h:196
float32_t brakeTorque
torque value in Nm
Definition: VehicleIO.h:154
uint64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:89
float32_t steeringWheelAngle
Steering wheel angle (-10.0 to 10.0 ± 0.01rad)
Definition: VehicleIO.h:199
float32_t brakeTorqueActual
Actual applied brake torque value (Nm)
Definition: VehicleIO.h:212
dwBool gearValid
True if setting gear.
Definition: VehicleIO.h:168
dwBool speedValid
True if setting speed.
Definition: VehicleIO.h:167
NVIDIA DriveWorks API: Core Methods
float32_t brakeTorqueRequested
Requested value of brake torque (Nm)
Definition: VehicleIO.h:211
dwTime_t speedTimestamp
Time at which speed was updated.
Definition: VehicleIO.h:197
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.
dwBool buttonCruiseControlDecrement
Definition: VehicleIO.h:224
dwVehicleIOOverrides
Definition: VehicleIO.h:96
dwVehicleIODrivingMode
Definition: VehicleIO.h:64
NVIDIA DriveWorks API: Core Exports
dwVehicleIOGear gear
Desired gear: 0=UNKNOWN, 1=PARK, 2=REVERSE, 3=NEUTRAL, 4=DRIVE.
Definition: VehicleIO.h:157
dwBool brakePercent
if true, value is in percent, otherwise direct pedal position
Definition: VehicleIO.h:152
dwBool buttonCruiseControlCancel
Definition: VehicleIO.h:221
DW_API_PUBLIC dwStatus dwVehicleIO_sendVehicleCommand(const dwVehicleIOCommand *cmd, dwSensorHandle_t hsensor, dwVehicleIOHandle_t obj)
Send a vehicle command to the VehicleIO.
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: Sensors.h:80
dwVehicleIOFaults
Definition: VehicleIO.h:87
dwStatus
Status definition.
Definition: Status.h:167
NVIDIA DriveWorks API: Sensors
Safety checks suitable for collision avoidance logic (right now same as NO_SAFETY below)...
Definition: VehicleIO.h:76
float32_t steeringSpeed
Desired speed of the turning command rad/s.
Definition: VehicleIO.h:145
DW_API_PUBLIC dwStatus dwVehicleIO_reset(dwVehicleIOHandle_t obj)
Reset VehicleIO to default state.
float32_t inverseSteeringR
Inverse turning radius of the vehicle on the road.
Definition: VehicleIO.h:202
dwBool passengerAirbag
Definition: VehicleIO.h:235
DW_API_PUBLIC dwStatus dwVehicleIO_release(dwVehicleIOHandle_t *obj)
Release used memory and close all modules.
dwBool buttonCruiseControlGapIncrement
Definition: VehicleIO.h:225
float32_t fuelLevel
(0 to 1 ± 0.01 fraction of tank volume, unitless)
Definition: VehicleIO.h:241
float32_t steeringWheelTorque
Steering wheel torque (0 to 10.0 ± 0.01 Nm)
Definition: VehicleIO.h:200
dwVehicleIOTurnSignal turnSig
Turn signal value.
Definition: VehicleIO.h:158
dwBool buttonLaneAssistOnOff
Definition: VehicleIO.h:227
float32_t brakeValue
Current brake value (0..1 ± 0.01 fraction of max pedal depressed, unitless)
Definition: VehicleIO.h:209
DW_API_PUBLIC dwStatus dwVehicleIO_consume(const dwCANMessage *msg, dwVehicleIOHandle_t obj)
Parse a received CAN message.
NVIDIA DriveWorks API: CAN
dwBool buttonCruiseControlOnOff
Definition: VehicleIO.h:219
dwVehicleIOTurnSignal turnSignal
Turn signal value.
Definition: VehicleIO.h:244
float32_t throttleValue
range 0.0 to 1.0
Definition: VehicleIO.h:149
Comfortable driving is expected (most conservative).
Definition: VehicleIO.h:68
dwVehicleIOGear gearCmd
Last acknowledged gear from a command.
Definition: VehicleIO.h:243
uint8_t dwBool
Definition: Types.h:79
float32_t brakeValue
range 0.0 to 1.0
Definition: VehicleIO.h:153
dwBool throttlePercent
if true, value is in percent, otherwise direct pedal position
Definition: VehicleIO.h:148
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
dwBool doorTrunk
Definition: VehicleIO.h:233
float32_t throttleCmd
Last acknowledged throttle value from a command (0..1 ± 0.01 fraction of max pedal depressed...
Definition: VehicleIO.h:208
dwBool enable
True if we are driving by wire. Has to always be set.
Definition: VehicleIO.h:141
struct dwVehicleIOObject * dwVehicleIOHandle_t
Definition: VehicleIO.h:62
float32_t steering
Desired steering wheel angle (rad)
Definition: VehicleIO.h:144
dwVehicleIOOverrides overrides
Overrides in place (0 = none)
Definition: VehicleIO.h:246
dwBool buttonCruiseControlResetCancel
Definition: VehicleIO.h:222
dwVehicleIOGear gear
Vehicle gear.
Definition: VehicleIO.h:242
dwBool steeringValid
True if setting steering.
Definition: VehicleIO.h:166
DW_API_PUBLIC dwStatus dwVehicleIO_initialize(dwVehicleIOHandle_t *obj, dwVehicleIOType type, const dwVehicle *properties, dwContextHandle_t ctx)
Initialize VehicleIO and prepare all internal structures.
dwBool doorPassenger
Definition: VehicleIO.h:229
dwBool clearFaults
Setting > 0 clears any canbus faults/errors.
Definition: VehicleIO.h:161
dwBool buckleDriver
Definition: VehicleIO.h:236
dwBool buttonCruiseControlIncrement
Definition: VehicleIO.h:223
dwBool doorRearLeft
Definition: VehicleIO.h:230
dwVehicleIOType
Definition: VehicleIO.h:82
VehicleIO will bypass all safety checks.
Definition: VehicleIO.h:79
#define DW_API_PUBLIC
Definition: Exports.h:76
Holds a CAN package.
Definition: CAN.h:109
DW_API_PUBLIC dwStatus dwVehicleIO_getVehicleState(dwVehicleIOState *state, dwVehicleIOHandle_t obj)
Retrieve current vehicle state.
Properties of the vehicle.
dwBool passengerDetect
Definition: VehicleIO.h:234
Same as above, but unsafe commands are clamped to safe limits and warnings are isssued.
Definition: VehicleIO.h:72