DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

src/dw/rig/doc_public/usecase0.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2021 NVIDIA CORPORATION. All rights reserved.
2 
3 @page rigconfiguration_usecase0 Rig File Format
4 
5 A rig file contains two major fields to define sensors and vehicles, that is,
6 
7  {
8  "rig": {
9  "sensors": [ { sensor I }, { sensor II }, ... ],
10  "vehicle": { vehicle }
11  },
12  "version":
13  }
14 
15 # Sensor Field
16 
17 Each sensor field provides information on each sensor and can be categorized into two types: camera field and non-camera field.
18 
19 ## 1. Camera Field
20 
21 Each camera field is an array that describes each specific camera in the sensor suite. The following code snippet shows how the camera field is structured,
22 
23  {
24  "name": "camera:front:center:60fov",
25  "nominalSensor2Rig": {
26  "quaternion": [
27  0.0,
28  0.0,
29  0.0,
30  1.0
31  ],
32  "t": [
33  0.0,
34  0.0,
35  0.0
36  ]
37  },
38  "parameter": "camera-name=SF3325,interface=csi-a,link=0,output-format=raw+yuv,fifo-size=1,warn-per-frame=0",
39  "properties": {
40  "Model": "ftheta",
41  "bw-poly": "0.0 0.000545421498827636 -1.6216719633103e-10 -4.64720492990289e-12 2.85224527762934e-16",
42  "cx": "960",
43  "cy": "604",
44  "height": "1208",
45  "width": "1920",
46  "car-mask": "camera:front:center:60fov.pgm"
47  },
48  "protocol": "camera.gmsl",
49  "sensor2Rig": {
50  "quaternion": [
51  0.0,
52  0.0,
53  0.0,
54  1.0
55  ],
56  "t": [
57  0.0,
58  0.0,
59  0.0
60  ]
61  },
62  "car-mask": {
63  "data/rle16-base64": "//8BjoABAQAA3QEBBQAA2gEBBwAA2AEBC...",
64  "resolution": [
65  480,
66  302
67  ]
68  }
69 
70 **name**: *camera* : *front* | *rear* : *left* | *center* | *right* : *60fov* | *120fov*
71 
72 **parameter**: [camera parameters](@ref dwx_sensor_enum_sample)
73 
74 **properties**: Properties are stored in name=value pairs and implement properties which are specific for a certain sensor in a generic way. A camera can specify calibration parameters, e.g. the intrinsic parameters, in here.
75 
76 **properties->Model**: *ftheta* | *ocam* | *pinhole*
77 
78 This determines the supported optical camera models, which defines the mapping between optical rays and pixel coordinates. Each model has a separate set of parameters `dwFThetaCameraConfig`, `dwOCamCameraConfig`, `dwPinholeCameraConfig`.
79 
80 **car-mask**: The `car-mask` *property* specifies a (optional) binary image file (currently `.pgm` images are supported) representing a binary mask of the ego-car in the camera image, separating it from the scene. Also, (optional) serialized car mask images are supported, which are represented by a serialization of the binary car mask images in the `car-mask` *field*. A `car-mask` image file property will be converted into a `car-mask` field on rig file serialization, and `car-mask` image file properties always have precedence over serialized car masks (to be able to update them). Car masks are important for, e.g., accurate self-calibration of the given camera.
81 
82 **protocol**: For camera sensors, protocol must be *camera.gmsl*
83 
84 <a name="sensor2Rig"></a>
85 **sensor2Rig**:
86 
87 This is the sensor to rig transformation for a camera, and can be represented in two forms,
88 
89 1.
90 
91  {
92  "quaternion": [q_x, q_y, q_z, q_w],
93  "t": [t_x, t_y, t_z]
94  }
95 
96 
97 2.
98 
99  {
100  "roll-pitch-yaw": [roll, pitch, yaw],
101  "t": [t_x, t_y, t_z]
102  }
103 
104 This transformation relates the camera and the rig coordinate system to each other, i.e. translation in meters and roll-pitch-yaw in degrees. For example, the origin in camera coordinate system is the position of the camera in rig coordinates. The self-calibration might remove this field, and substitute it with *correction_rig_T* and *correction_sensor_R_FLU* transformations after the calibration.
105 
106 <a name="nominalSensor2Rig"></a>
107 **nominalSensor2Rig**:
108 
109 This is the nominal sensor to rig transformation for a camera, and can be represented in two forms,
110 
111 1.
112 
113  {
114  "quaternion": [q_x, q_y, q_z, q_w],
115  "t": [t_x, t_y, t_z]
116  }
117 
118 2.
119 
120  {
121  "roll-pitch-yaw": [roll, pitch, yaw],
122  "t": [t_x, t_y, t_z]
123  }
124 
125 This transformation differs from *sensor2rig* transformation in that it represents a static reference transformation from factory calibration and/or mechanical drawings, whereas *sensor2rig* can change over time.
126 
127 <a name="correction_rig_T"></a>
128 **correction_rig_T**:
129 
130 This shows the corrections in the translation with respect to the *nominalSensor2Rig* transformation, which is estimated and added to the rig file by the self-calibration. The self-calibration saves the translation updates only as,
131 
132  {
133  "t": [t_x, t_y, t_z]
134  }
135 
136 <a name="correction_sensor_R_FLU"></a>
137 **correction_sensor_R_FLU**:
138 
139 This shows the corrections in the rotation with respect to the *nominalSensor2Rig* transformation, which is estimated and added to the rig file by the self-calibration. The self-calibration saves the rotation updates only as,
140 
141  {
142  "roll-pitch-yaw": [roll, pitch, yaw],
143  }
144 
145 <a name="nominalSensor2Rig_FLU"></a>
146 **nominalSensor2Rig_FLU**:
147 
148 During the self-calibration, *nominalSensor2Rig* transformation is renamed and saved as *nominalSensor2Rig_FLU* without any change in the values as,
149 
150  {
151  "roll-pitch-yaw": [roll, pitch, yaw],
152  "t": [t_x, t_y, t_z]
153  }
154 
155 @note To summarize the self-calibration changes in the rig files,
156 - Rig files before self-calibration: *sensor2Rig* + *nominalSensor2Rig*
157 - Rig files after self-calibration: *correction_sensor_R_FLU* + *correction_rig_T* + *nominalSensor2Rig_FLU*
158 
159 ## 2. Non-Camera Field
160 
161 NVIDIA<sup>&reg;</sup> DriveWorks currently supports the following non-camera sensors:
162 - CAN
163 - GPS
164 - IMU
165 - Lidar
166 - Radar
167 
168 The following code snippet shows an example for the IMU sensor field,
169 
170  {
171  "name": "imu:xsens",
172  "nominalSensor2Rig": {
173  "quaternion": [
174  0.0,
175  0.0,
176  0.0,
177  1.0
178  ],
179  "t": [
180  0.0,
181  0.0,
182  0.0
183  ]
184  },
185  "parameter": "device=/dev/ttyUSBXSENS,baudrate=230400,time-smoothing=true",
186  "properties": null,
187  "protocol": "imu.xsens",
188  "sensor2Rig": {
189  "quaternion": [
190  0.0,
191  0.0,
192  0.0,
193  1.0
194  ],
195  "t": [
196  0.0,
197  0.0,
198  0.0
199  ]
200  }
201  }
202 
203 The following code snippet shows an example for the GPS sensor field,
204 
205  {
206  "name": "gps:xsens",
207  "correction_rig_T": [
208  0.0,
209  0.0,
210  0.0
211  ],
212  "correction_sensor_R_FLU": {
213  "roll-pitch-yaw": [
214  0.0,
215  0.0,
216  0.0
217  ]
218  },
219  "nominalSensor2Rig_FLU": {
220  "roll-pitch-yaw": [
221  0.0,
222  0.0,
223  0.0
224  ],
225  "t": [
226  0.0,
227  0.0,
228  0.0
229  ]
230  },
231  "parameter": "file=device=/dev/ttyUSBXSENS,baudrate=230400",
232  "properties": null,
233  "protocol": "gps.xsens"
234  }
235 
236 **name**: *can* | *gps* | *imu* | *lidar* | *radar*
237 
238 **parameter**: [sensor parameters](@ref dwx_sensor_enum_sample)
239 
240 **properties**:
241 
242 Properties are stored in name=value pairs and implement properties which are specific for a certain sensor in a generic way. For example, an IMU might store bias values there, etc.
243 
244 **protocol**:
245 
246 - CAN: *can.socket* | *can.aurix*
247 - GPS: *gps.uart* | *gps.xsens*
248 - IMU: *imu.uart* | *imu.xsens*
249 - Lidar: *lidar.socket*
250 - Radar: *radar.socket*
251 
252 **sensor2Rig**: [sensor2Rig transformation](#sensor2Rig)
253 
254 **nominalSensor2Rig**: [nominalSensor2Rig transformation](#nominalSensor2Rig)
255 
256 **correction_rig_T**: [correction_rig_T transformation](#correction_rig_T)
257 
258 **correction_sensor_R_FLU**: [correction_sensor_R_FLU transformation](#correction_sensor_R_FLU)
259 
260 **nominalSensor2Rig_FLU**: [nominalSensor2Rig_FLU transformation](#nominalSensor2Rig_FLU)
261 
262 # Vehicle Field
263 
264 The following rig snippet shows the vehicle field structure,
265 
266  {
267  "vehicle": {
268  "valid": true,
269  "value": {
270  "axleFront": {
271  "corneringStiffness": 0.0,
272  "position": 0.0,
273  "track": 0.0,
274  "wheelRadiusLeft": 0.0,
275  "wheelRadiusRight": 0.0
276  },
277  "axleRear": {
278  "corneringStiffness": 0.0,
279  "position": 0.0,
280  "track": 0.0,
281  "wheelRadiusLeft": 0.0,
282  "wheelRadiusRight": 0.0
283  },
284  "body": {
285  "boundingBoxPosition": [0.0, 0.0, 0.0],
286  "centerOfMass": [0.0, 0.0, 0.0],
287  "height": 0.0,
288  "inertia": [0.0, 0.0, 0.0],
289  "length": 0.0,
290  "mass": 0.0,
291  "width": 0.0
292  },
293  "powertrain": {
294  "brakeActuatorTimeConstant": 0.0,
295  "effectiveMass": 0.0,
296  "throttleActuatorTimeConstant": 0.0,
297  "torqueLUT": {
298  "throttlePedalInput": "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
299  "throttleSpeedInput": "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
300  "throttleTorqueOutput": [
301  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
302  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
303  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
304  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
305  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
306  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
307  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
308  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
309  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
310  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
311  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
312  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
313  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
314  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
315  "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0"
316  ],
317  "brakePedalInput": "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0",
318  "brakeTorqueOutput": "0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0"
319  }
320  },
321  "steering": {
322  "driveByWireTimeConstant": 0.0,
323  "driveByWireTimeDelay": 0.0,
324  "maxSteeringWheelAngle": 0.0,
325  "steeringWheelToSteeringMap": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
326  },
327  "suspension": {
328  "pitchDampingRatio": 0.0,
329  "pitchNaturalFrequency": 0.0
330  },
331  "hasCabin": false,
332  "numTrailers": 0
333  }
334  }
335  }
336 
337 For the full implementation refer to `dwVehicleGeneric`
338 
339 # Vehicle IO Field
340 
341 Vehicle IO field describes Drive-By-Wire interface of a vehicle.
342 
343  "vehicleio": [
344  {
345  "type": "custom",
346  "parent-sensor": "can:vehicle",
347  "dbc-file": "AutonomousVehicleCANSignals.dbc"
348  }
349  ],
350  "sensors": [
351  {
352  "name": "can:vehicle",
353  "parameter": "device=can0",
354  "protocol": "can.socket",
355  "properties": null,
356  "nominalSensor2Rig": { "quaternion": [ 0.0, 0.0, 0.0, 1.0 ], "t": [ 0.0, 0.0, 0.0 ] },
357  "sensor2Rig": { "quaternion": [ 0.0, 0.0, 0.0, 1.0 ], "t": [ 0.0, 0.0, 0.0 ] }
358  }
359  ],
360 
361 **type**: [Type of a Drive-By-Wire interface.](@ref vehicleio_mainsection)
362 
363 **parent-sensor**: Name of a sensor that is used to communicate with Drive-By-Wire hardware.
364 
365 **dbc-file**: A DBC file for Vehicle IO drivers that require one.
366 
367 For more information, please refer to
368 [Vehicle IO Documentation](@ref vehicleio_mainsection),
369 [Vehicle IO Sample](@ref dwx_vehicleio_sample), and
370 [Vehicle IO Plugin sample](@ref dwx_vehicleio_plugin_sample).