1 # Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 @page dwx_recording_library DriveWorks Recording Library
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.
9 Currently, there are 6 types of sensors supported (camera, CAN, GPS, IMU, Lidar, Radar)
10 and the JSON file is written this way.
17 This is the version number. If this version number mismatches the in code
18 version number, the recorder will throw an exception.
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.
29 "log-level": "verbose",
32 This is log level used within DriveWorks. Valid values are `verbose`, `debug`, `warn`, or `error`.
34 "file-buffer-size": 2097152,
37 This is the size of the buffer for file writing.
41 "separate-thread": true,
42 "write-file-pattern": "video_*",
45 "protocol": "camera.gmsl",
46 "params": "camera-type=ar0231-rccb,csi-port=ef,camera-count=4,fifo-size=12",
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:
65 "separate-thread": true,
66 "write-file-pattern": "video_*",
69 "protocol": "camera.gmsl",
70 "params": "camera-type=ar0231-rccb,csi-port=ab,camera-count=4,fifo-size=12",
79 "protocol": "camera.gmsl",
80 "params": "camera-type=ar0231-rccb,csi-port=cd,camera-count=4,fifo-size=12",
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`.
100 The `protocol` for camera can be `camera.gmsl` only.
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`.
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.
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`.
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
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.
129 @note It is not possible to intermix cameras of different type on the same CSI port.
133 "separate-thread": false,
134 "write-file-pattern": "can_*",
137 "protocol": "can.socket",
138 "params": "device=can0",
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.
154 "separate-thread": false,
155 "write-file-pattern": "gps_*",
158 "protocol": "gps.uart",
159 "params": "device=/dev/ttyACM0,baud=115200",
169 "separate-thread": false,
170 "write-file-pattern": "gps_*",
173 "protocol": "gps.xsens",
174 "params": "device=0,frequency=100",
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.
190 "separate-thread": false,
191 "write-file-pattern": "imu_*",
194 "protocol": "imu.uart",
195 "params": "device=/dev/ttyUSB0,baud=115200",
205 "separate-thread": false,
206 "write-file-pattern": "imu_*",
209 "protocol": "imu.xsens",
210 "params": "device=0,frequency=100",
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.
225 "separate-thread": false,
226 "write-file-pattern": "lidar_*",
229 "protocol": "lidar.socket",
230 "params": "ip=192.168.1.201,port=2368,device=VELO_VLP16,scan-frequency=10",
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.
245 "separate-thread": false,
246 "write-file-pattern": "radar_*",
249 "protocol": "radar.socket",
250 "params": "ip=192.168.1.201,port=2368,device=DELPHI_ESR2_5",
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.