DriveWorks SDK Reference

| 0.6.67 Release

/builds/driveav/dw/sdk/tools/recorder/libs/dwrecorder/README.md
Go to the documentation of this file.
1 # Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_recording_library DriveWorks Recording Library
4 
5 The DriveWorks recording library provides functionality to easily record multiple
6 sensors. The library is configurable with a JSON file. The
7 JSON file syntax is described as below.
8 
9 Currently, there are 6 types of sensors supported (camera, CAN, GPS, IMU, Lidar, Radar)
10 and the JSON file is written this way.
11 
12 @code
13 {
14  "version": "0.8",
15 @endcode
16 
17 This is the version number. If this version number mismatches the in code
18 version number, the recorder will throw an exception.
19 
20 @code
21  "path": ".",
22 @endcode
23 
24 This is where the recording library stores its captured data. Each time a new
25 capture session is invoked, a new folder is created at this path with the time
26 and location (if available) in the folder name.
27 
28 @code
29  "log-level": "verbose",
30 @endcode
31 
32 This is log level used within DriveWorks. Valid values are `verbose`, `debug`, `warn`, or `error`.
33 @code
34  "file-buffer-size": 2097152,
35 @endcode
36 
37 This is the size of the buffer for file writing.
38 
39 @code
40  "camera": {
41  "separate-thread": true,
42  "write-file-pattern": "video_*",
43  "sensors": [
44  {
45  "protocol": "camera.gmsl",
46  "params": "camera-type=ar0231-rccb,csi-port=ef,camera-count=4,fifo-size=12",
47  "channel-names": [
48  "first",
49  "second",
50  "third",
51  "fourth"
52  ]
53  }
54  ]
55  },
56 @endcode
57 
58 Each sensor group is set up the same way. Multiple sensors are added by creating
59 a new object in the `sensors` array section of each group.
60 For example to connect four cameras to each of the "ab" and "cd" interfaces the
61 code above can be replaced with:
62 
63 @code
64  "camera": {
65  "separate-thread": true,
66  "write-file-pattern": "video_*",
67  "sensors": [
68  {
69  "protocol": "camera.gmsl",
70  "params": "camera-type=ar0231-rccb,csi-port=ab,camera-count=4,fifo-size=12",
71  "channel-names": [
72  "ab_first",
73  "ab_second",
74  "ab_third",
75  "ab_fourth"
76  ]
77  },
78  {
79  "protocol": "camera.gmsl",
80  "params": "camera-type=ar0231-rccb,csi-port=cd,camera-count=4,fifo-size=12",
81  "channel-names": [
82  "cd_first",
83  "cd_second",
84  "cd_third",
85  "cd_fourth"
86  ]
87  }
88  ]
89  },
90 @endcode
91 
92 `write-file-pattern`must contain an asterisk, which is replaced by the channel number
93 or channel-name of the sensor being recorded. The `write-file-pattern` needs no extension
94 for any of the sensors, as this is automatically inferred based on the sensor params.
95 Each sensor group can share a capture thread with the other sensor groups by using
96 `separate-thread=false`. If `separate-thread=true`, a new thread spawns for
97 this sensor group to capture and record data separately from the other sensor groups.
98 If `separate-thread` is not present, it defaults to `false`.
99 
100 The `protocol` for camera can be `camera.gmsl` only.
101 
102 The `params` must follow the params given to a Driveworks sensor at initialization.
103 In order to record in other formats besides h264, add
104 `output-format=[raw,lraw,h264,raw+h264,lraw+h264]` with one of the listed output
105 formats to the `params`.
106 In order to record camera frames at a lower rate than the default, use
107 `frame-skip-count` in the `params`.
108 
109 For example, a value of
110 `frame-skip-count=1` records at 15 FPS if the camera hardware
111 runs at 30 FPS. Setting `record-frame-count=2` with `frame-skip-count=1`
112 records two (2) frames and skips 1, and then repeats.
113 
114 For sensors that control multiple sources (such as camera), `channel-names` array
115 can be specified. This replaces the `*` in the `write-file-pattern` when
116 the file is saved to disk. If no `channel-names` array is specified, the `*` in
117 `write-file-pattern` is replaced with the channel number. Specific GMSL
118 cameras can be selected by using the `camera-mask=1111` where a `0` represents
119 off and a `1` represents on. This is an alternative to the `camera-count`
120 option in the `params`.
121 
122 In order to record asyncronously, add `async-record=1` to the `params`. The default
123 is `async-record=0`, which writes to disk on the same thread where the camera is
124 read.
125 
126 For certain kinds of camera, e.g., ar0231-rccb, the camera framerate can be
127 controlled by the `required-framerate` option. Valid values for now are 20, 30, and 36.
128 
129 @note It is not possible to intermix cameras of different type on the same CSI port.
130 
131 @code
132  "can" : {
133  "separate-thread": false,
134  "write-file-pattern": "can_*",
135  "sensors" : [
136  {
137  "protocol": "can.socket",
138  "params": "device=can0",
139  "channel-name": "0"
140  }
141  ]
142  },
143 @endcode
144 
145 The CAN `protocol` supports both `can.socket` and `can.aurix`. In general, it
146 follows the same rules as camera. To add multiple CAN sensors, add another
147 object literal in the `sensors` array. `channel-name` specifies the replacement
148 for the `*` in `write-file-pattern` and is optional. If none is specified, it
149 defaults to a numeric system.
150 
151 For gps.uart:
152 @code
153  "gps" : {
154  "separate-thread": false,
155  "write-file-pattern": "gps_*",
156  "sensors" : [
157  {
158  "protocol": "gps.uart",
159  "params": "device=/dev/ttyACM0,baud=115200",
160  "channel-name": "0"
161  }
162  ]
163  },
164 @endcode
165 
166 For gps.xsens:
167 @code
168  "gps" : {
169  "separate-thread": false,
170  "write-file-pattern": "gps_*",
171  "sensors" : [
172  {
173  "protocol": "gps.xsens",
174  "params": "device=0,frequency=100",
175  "channel-name": "0"
176  }
177  ]
178  },
179 @endcode
180 
181 GPS `protocol` supports `gps.uart` and `gps.xsens`. In general, it
182 follows the same rules as camera. To add multiple GPS sensors, add another
183 object literal in the `sensors` array. `channel-name` specifies the replacement
184 for the `*` in `write-file-pattern` and is optional. If none is specified, it
185 defaults to a numeric system.
186 
187 For imu.uart
188 @code
189  "imu" : {
190  "separate-thread": false,
191  "write-file-pattern": "imu_*",
192  "sensors" : [
193  {
194  "protocol": "imu.uart",
195  "params": "device=/dev/ttyUSB0,baud=115200",
196  "channel-name": "0"
197  }
198  ]
199  },
200 @endcode
201 
202 For imu.xsens:
203 @code
204  "imu" : {
205  "separate-thread": false,
206  "write-file-pattern": "imu_*",
207  "sensors" : [
208  {
209  "protocol": "imu.xsens",
210  "params": "device=0,frequency=100",
211  "channel-name": "0"
212  }
213  ]
214  },
215 @endcode
216 
217 IMU `protocol` supports `imu.uart` and `imu.xsens`. In general, it
218 follows the same rules as camera. To add multiple IMU sensors, add another
219 object literal in the `sensors` array. `channel-name` specifies the replacement
220 for the `*` in `write-file-pattern` and is optional. If none is specified, it
221 defaults to a numeric system.
222 
223 @code
224  "lidar" : {
225  "separate-thread": false,
226  "write-file-pattern": "lidar_*",
227  "sensors" : [
228  {
229  "protocol": "lidar.socket",
230  "params": "ip=192.168.1.201,port=2368,device=VELO_VLP16,scan-frequency=10",
231  "channel-name": "0"
232  }
233  ]
234  },
235 @endcode
236 
237 Lidar `protocol` supports `lidar.socket`. In general,
238 it follows the same rules as camera. To add multiple Lidar sensors, add
239 another object literal in the `sensors` array. `channel-name` specifies the replacement
240 for the `*` in `write-file-pattern` and is optional. If none is specified, it
241 defaults to a numeric system.
242 
243 @code
244  "radar" : {
245  "separate-thread": false,
246  "write-file-pattern": "radar_*",
247  "sensors" : [
248  {
249  "protocol": "radar.socket",
250  "params": "ip=192.168.1.201,port=2368,device=DELPHI_ESR2_5",
251  "channel-name": "0"
252  }
253  ]
254  },
255 @endcode
256 
257 Radar `protocol` supports `radar.socket`. In general,
258 it follows the same rules as camera. To add multiple Radar sensors, add
259 another object literal in the `sensors` array. `channel-name` specifies the replacement
260 for the `*` in `write-file-pattern` and is optional. If none is specified, it
261 defaults to a numeric system.
262 
263 @code
264 }
265 @endcode