DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

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