xwr.capture
¶
Interface implementation for the DCA1000EVM capture card.
xwr.capture.DCA1000EVM
¶
DCA1000EVM Interface.
usage
- Initialization parameters can be defaults.
- Setup with
.setup(...)
with the appropriateLVDS.TWO_LANE
(2544, 2944, 1843, 1642) orLVDS.FOUR_LANE
(1243, 1443). - Start recording with
.start(...)
. - Start the radar.
- Stop recording with
.stop()
. - Stop the radar.
Documented by the DCA1000EVM Data Capture Card User's Guide (Rev A); based on
a (little-endian) UDP protocol (Sec 5). Included C++ source code exerpts
from the mmWave API are used as a secondary reference; see the
ReferenceCode/DCA1000/SourceCode
folder in a mmWave Studio
install.
Networking Configuration
- The network interface connected to the DCA1000EVM should be
configured with a static IP address matching the provided
sys_ip
, e.g.,192.168.33.30
with a subnet mask of255.255.255.0
. - To reduce dropped packets, the receive socket buffer size should also be increased to at least 2 frames of data (even larger is fine).
Warning
The radar should be started afer DCA1000EVM.start
to ensure
that the data are correctly aligned with respect to the byte count.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sys_ip
|
str
|
IP of this computer associated with the desired ethernet interface. |
'192.168.33.30'
|
fpga_ip
|
str
|
Static IP of the DCA1000EVM FPGA. |
'192.168.33.180'
|
data_port
|
int
|
Port used for recording data. |
4098
|
config_port
|
int
|
Port used for configuration. |
4096
|
timeout
|
float
|
Config socket read timeout. |
1.0
|
socket_buffer
|
int
|
Receive socket buffer size. Ensure that |
2048000
|
name
|
str
|
logger name; should be human-readable. |
'DCA1000EVM'
|
Raises:
Type | Description |
---|---|
TimeoutError
|
request timed out (is the device connected?). |
DCAException
|
exception raised by the FPGA. |
Source code in src/xwr/capture/api.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
|
configure_eeprom
¶
configure_eeprom(
sys_ip: str = "192.168.33.30",
fpga_ip: str = "192.168.33.180",
fpga_mac: str = "12:34:56:78:90:12",
config_port: int = 4096,
data_port: int = 4098,
) -> None
Configure EEPROM; contains IP, MAC, port information.
Danger
Use with extreme caution. This should never be used in normal operation. May require delay before use depending on the previous command.
If this operation messes up the system IP and FPGA IP, the radar needs to be switched to hard-coded IP mode (user switch 1; see the TI user guide1) and the EEPROM correctly reprogrammed.
Source code in src/xwr/capture/api.py
configure_fpga
¶
configure_fpga(
lvds: LVDS = TWO_LANE,
log: Log = RAW_MODE,
transfer: DataTransfer = CAPTURE,
format: DataFormat = BIT16,
capture: DataCapture = ETH_STREAM,
) -> None
Configure FPGA.
Note
This seems to cause the FPGA to ignore requests for a short time
after. Sending system_aliveness
pings until it responds seems to
be the best way to check when it's ready again.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lvds
|
LVDS
|
|
TWO_LANE
|
log
|
Log
|
raw or data separated mode; we assume |
RAW_MODE
|
transfer
|
DataTransfer
|
capture or playback; we assume |
CAPTURE
|
format
|
DataFormat
|
ADC bit depth; we assume |
BIT16
|
capture
|
DataCapture
|
data capture mode; we assume |
ETH_STREAM
|
Source code in src/xwr/capture/api.py
configure_record
¶
configure_record(delay: float = 25.0) -> None
Configure data packets (with a packet delay in us).
The packet delay must be between 5 and 500 us (Table 19[^1]). This sets the theoretical maximum throughput to between 193 and 706 Mbps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
delay
|
float
|
packet delay, in microseconds. |
25.0
|
Source code in src/xwr/capture/api.py
flush
¶
Clear data receive buffers.
Source code in src/xwr/capture/api.py
read_fpga_version
¶
Get current FPGA version.
Returns:
Type | Description |
---|---|
tuple[int, int, bool]
|
A |
Source code in src/xwr/capture/api.py
reset_ar_device
¶
Reset (i.e. reboot) Radar (AR - Automotive Radar) device.
setup
¶
Configure DCA1000EVM capture card.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
delay
|
float
|
packet delay in microseconds. |
5.0
|
lvds
|
LVDS
|
|
TWO_LANE
|
Source code in src/xwr/capture/api.py
start
¶
stop
¶
stream
¶
stream(shape: Sequence[int] = []) -> Iterator[RadarFrame]
Get a python iterator corresponding to the data stream.
Returns only when the stream is exhausted (i.e., when the radar no longer sends any data). Thus, no method is provided to stop receiving the stream directly; callers should instead send a stop command to the radar or capture card, which then terminates the stream and causes this method to return.
Warning
shape
should have twice as many samples on the last axis
to account for two IQ uint16s per sample. Note that these samples
are also in IIQQ order, not IQ order; see
RadarFrame
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape
|
Sequence[int]
|
shape of the data to be received. |
[]
|