xwr 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. xwr-0.3.2/.github/workflows/ci.yml +30 -0
  2. xwr-0.3.2/.github/workflows/docs.yml +47 -0
  3. xwr-0.3.2/.gitignore +162 -0
  4. xwr-0.3.2/.pre-commit-config.yaml +20 -0
  5. xwr-0.3.2/LICENSE +21 -0
  6. xwr-0.3.2/PKG-INFO +88 -0
  7. xwr-0.3.2/README.md +38 -0
  8. xwr-0.3.2/demo/config.yaml +19 -0
  9. xwr-0.3.2/demo/demo.py +94 -0
  10. xwr-0.3.2/docs/dca/api.md +1 -0
  11. xwr-0.3.2/docs/dca/defines.md +1 -0
  12. xwr-0.3.2/docs/dca/types.md +1 -0
  13. xwr-0.3.2/docs/develop.md +70 -0
  14. xwr-0.3.2/docs/images/awr1642boost.jpg +0 -0
  15. xwr-0.3.2/docs/images/awr1843aopevm-inset.jpg +0 -0
  16. xwr-0.3.2/docs/images/awr1843aopevm.jpg +0 -0
  17. xwr-0.3.2/docs/images/awr1843boost-inset.jpg +0 -0
  18. xwr-0.3.2/docs/images/awr1843boost.jpg +0 -0
  19. xwr-0.3.2/docs/images/dca1000evm.jpg +0 -0
  20. xwr-0.3.2/docs/images/demo.png +0 -0
  21. xwr-0.3.2/docs/index.md +111 -0
  22. xwr-0.3.2/docs/radar/api.md +6 -0
  23. xwr-0.3.2/docs/radar/defines.md +1 -0
  24. xwr-0.3.2/docs/radar/raw.md +1 -0
  25. xwr-0.3.2/docs/rsp/jax.md +1 -0
  26. xwr-0.3.2/docs/rsp/nn.md +1 -0
  27. xwr-0.3.2/docs/rsp/numpy.md +1 -0
  28. xwr-0.3.2/docs/rsp/rsp.md +1 -0
  29. xwr-0.3.2/docs/rsp/torch.md +1 -0
  30. xwr-0.3.2/docs/setup.md +325 -0
  31. xwr-0.3.2/docs/stylesheets/extra.css +24 -0
  32. xwr-0.3.2/docs/system.md +6 -0
  33. xwr-0.3.2/docs/usage.md +206 -0
  34. xwr-0.3.2/mkdocs.yml +113 -0
  35. xwr-0.3.2/pyproject.toml +96 -0
  36. xwr-0.3.2/src/xwr/__init__.py +21 -0
  37. xwr-0.3.2/src/xwr/capture/__init__.py +6 -0
  38. xwr-0.3.2/src/xwr/capture/api.py +395 -0
  39. xwr-0.3.2/src/xwr/capture/defines.py +119 -0
  40. xwr-0.3.2/src/xwr/capture/types.py +145 -0
  41. xwr-0.3.2/src/xwr/config.py +195 -0
  42. xwr-0.3.2/src/xwr/nn/__init__.py +28 -0
  43. xwr-0.3.2/src/xwr/nn/representations.py +202 -0
  44. xwr-0.3.2/src/xwr/nn/utils.py +103 -0
  45. xwr-0.3.2/src/xwr/py.typed +0 -0
  46. xwr-0.3.2/src/xwr/radar/__init__.py +35 -0
  47. xwr-0.3.2/src/xwr/radar/api.py +309 -0
  48. xwr-0.3.2/src/xwr/radar/base.py +196 -0
  49. xwr-0.3.2/src/xwr/radar/defines.py +115 -0
  50. xwr-0.3.2/src/xwr/radar/raw.py +410 -0
  51. xwr-0.3.2/src/xwr/rsp/__init__.py +46 -0
  52. xwr-0.3.2/src/xwr/rsp/generic.py +334 -0
  53. xwr-0.3.2/src/xwr/rsp/jax/__init__.py +35 -0
  54. xwr-0.3.2/src/xwr/rsp/jax/rsp.py +204 -0
  55. xwr-0.3.2/src/xwr/rsp/jax/spectrum.py +172 -0
  56. xwr-0.3.2/src/xwr/rsp/numpy/__init__.py +36 -0
  57. xwr-0.3.2/src/xwr/rsp/numpy/rsp.py +174 -0
  58. xwr-0.3.2/src/xwr/rsp/torch/__init__.py +32 -0
  59. xwr-0.3.2/src/xwr/rsp/torch/rsp.py +167 -0
  60. xwr-0.3.2/src/xwr/system.py +240 -0
  61. xwr-0.3.2/tests/config.yaml +21 -0
  62. xwr-0.3.2/tests/test_capture.py +59 -0
  63. xwr-0.3.2/tests/test_rsp.py +109 -0
  64. xwr-0.3.2/uv.lock +2015 -0
@@ -0,0 +1,30 @@
1
+ name: Run CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Checkout code
13
+ uses: actions/checkout@v5
14
+
15
+ - name: Install uv with Python 3.12
16
+ uses: astral-sh/setup-uv@v6
17
+ with:
18
+ python-version: "3.12"
19
+
20
+ - name: Lint with ruff
21
+ run: |
22
+ uv run --extra dev --extra torch --extra nn --extra jax ruff check ./src
23
+
24
+ - name: Type check with pyright
25
+ run: |
26
+ uv run --extra dev --extra torch --extra nn --extra jax pyright ./src
27
+
28
+ - name: Run tests
29
+ run: |
30
+ uv run --extra dev --extra torch --extra nn --extra jax pytest -ra -- tests
@@ -0,0 +1,47 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+ permissions:
8
+ contents: read
9
+ pages: write
10
+ id-token: write
11
+
12
+ concurrency:
13
+ group: "pages"
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Check out
21
+ uses: actions/checkout@v5
22
+
23
+ # Install uv (fast Python package/dependency manager)
24
+ - name: Set up uv
25
+ uses: astral-sh/setup-uv@v6
26
+
27
+ - name: Sync docs environment
28
+ run: uv sync --extra docs
29
+
30
+ - name: Build MkDocs site
31
+ run: uv run mkdocs build --strict
32
+
33
+ - name: Upload Pages artifact
34
+ uses: actions/upload-pages-artifact@v3
35
+ with:
36
+ path: site
37
+
38
+ deploy:
39
+ runs-on: ubuntu-latest
40
+ needs: build
41
+ environment:
42
+ name: github-pages
43
+ url: ${{ steps.deployment.outputs.page_url }}
44
+ steps:
45
+ - name: Deploy to GitHub Pages
46
+ id: deployment
47
+ uses: actions/deploy-pages@v4
xwr-0.3.2/.gitignore ADDED
@@ -0,0 +1,162 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
@@ -0,0 +1,20 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: ruff
5
+ name: Lint with ruff
6
+ entry: uv run --extra dev --extra torch --extra jax --extra nn ruff check
7
+ language: system
8
+ types: [python]
9
+
10
+ - id: pyright
11
+ name: Type check with pyright
12
+ entry: uv run --extra dev --extra torch --extra jax --extra nn pyright
13
+ language: system
14
+ types: [python]
15
+
16
+ - id: pytest
17
+ name: Run pytest with coverage
18
+ entry: uv run --extra dev --extra torch --extra jax --extra nn pytest -- tests
19
+ language: system
20
+ pass_filenames: false
xwr-0.3.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 WiSELab-CMU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
xwr-0.3.2/PKG-INFO ADDED
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.4
2
+ Name: xwr
3
+ Version: 0.3.2
4
+ Summary: Linux-Compatible Real-Time Raw Data Capture for TI mmWave Radars.
5
+ Project-URL: Homepage, https://github.com/RadarML/xwr
6
+ Project-URL: Documentation, https://radarml.github.io/xwr
7
+ Project-URL: Issues, https://github.com/RadarML/xwr/issues
8
+ Author-email: Tianshu Huang <tianshu2@andrew.cmu.edu>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Typing :: Typed
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: beartype>=0.20
18
+ Requires-Dist: jaxtyping>=0.3.2
19
+ Requires-Dist: numpy>=1.19
20
+ Requires-Dist: pyfftw>=0.15.0
21
+ Requires-Dist: pyserial>=3.5
22
+ Requires-Dist: types-pyserial>=3.5
23
+ Provides-Extra: demo
24
+ Requires-Dist: matplotlib>=3.0; extra == 'demo'
25
+ Requires-Dist: pyqt6>=6.0.0; extra == 'demo'
26
+ Requires-Dist: pyyaml>=6.0; extra == 'demo'
27
+ Requires-Dist: rich>=13.0.0; extra == 'demo'
28
+ Requires-Dist: tyro>=0.8.0; extra == 'demo'
29
+ Provides-Extra: dev
30
+ Requires-Dist: coverage; extra == 'dev'
31
+ Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
32
+ Requires-Dist: pyright>=1.0.0; extra == 'dev'
33
+ Requires-Dist: pytest-cov; extra == 'dev'
34
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
35
+ Requires-Dist: ruff>=0.11.0; extra == 'dev'
36
+ Provides-Extra: docs
37
+ Requires-Dist: abstract-dataloader>=0.3.5; extra == 'docs'
38
+ Requires-Dist: mkdocs-material==9.6.*; extra == 'docs'
39
+ Requires-Dist: mkdocs==1.6.*; extra == 'docs'
40
+ Requires-Dist: mkdocstrings-python-xref==1.16.3; extra == 'docs'
41
+ Requires-Dist: mkdocstrings-python==1.16.6; extra == 'docs'
42
+ Requires-Dist: ruff>=0.11.0; extra == 'docs'
43
+ Provides-Extra: jax
44
+ Requires-Dist: jax>=0.4.0; extra == 'jax'
45
+ Provides-Extra: nn
46
+ Requires-Dist: torchvision>=0.15.0; extra == 'nn'
47
+ Provides-Extra: torch
48
+ Requires-Dist: torch>=2.0; extra == 'torch'
49
+ Description-Content-Type: text/markdown
50
+
51
+ # `xwr`: Linux-Compatible Real-Time Raw Data Capture for TI mmWave Radars
52
+
53
+ [![pypi version](https://img.shields.io/pypi/v/xwr.svg)](https://pypi.org/project/xwr/)
54
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/xwr)
55
+ ![PyPI - Types](https://img.shields.io/pypi/types/xwr)
56
+ ![License - MIT](https://img.shields.io/badge/license-MIT-green)
57
+ ![Typed](https://img.shields.io/badge/types-typed-brightgreen)
58
+ [![bear-ified](https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg)](https://beartype.readthedocs.io)
59
+
60
+ `xwr` is a pure-python, linux-based real time raw data capture system for TI mmWave radars, and includes four key components:
61
+
62
+ - [`xwr`](https://radarml.github.io/xwr/system/): a high-level data capture interface
63
+ - [`xwr.rsp`](https://radarml.github.io/xwr/rsp/rsp/): a radar signal processing library with Numpy, Pytorch, and Jax support
64
+ - [`xwr.radar`](https://radarml.github.io/xwr/radar/api/): a parameterized python interface for the default radar firmware
65
+ - [`xwr.capture`](https://radarml.github.io/xwr/dca/api/): a pure-python, real-time interface for the DCA1000EVM
66
+
67
+ See our [documentation site](https://radarml.github.io/xwr/) for more details, setup guides, the included demo, and more!
68
+
69
+ ## Requirements
70
+
71
+ `xwr` assumes a linux-based system and radar hardware which consists of the DCA1000EVM and a supported TI mmWave Radar (XWR) development board.
72
+
73
+ > [!IMPORTANT]
74
+ > Supported Devices:
75
+ > - AWR1843 Family: AWR1843Boost, AWR1843AOPEVM
76
+ > - AWR1642
77
+ >
78
+ > WIP:
79
+ > - AWR2544LOPEVM
80
+
81
+ ## Install
82
+
83
+ The `xwr` library is currently only distributed via github:
84
+
85
+ ```sh
86
+ # Install directly from github
87
+ pip install git+ssh://github.com/RadarML/xwr.git
88
+ ```
xwr-0.3.2/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # `xwr`: Linux-Compatible Real-Time Raw Data Capture for TI mmWave Radars
2
+
3
+ [![pypi version](https://img.shields.io/pypi/v/xwr.svg)](https://pypi.org/project/xwr/)
4
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/xwr)
5
+ ![PyPI - Types](https://img.shields.io/pypi/types/xwr)
6
+ ![License - MIT](https://img.shields.io/badge/license-MIT-green)
7
+ ![Typed](https://img.shields.io/badge/types-typed-brightgreen)
8
+ [![bear-ified](https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg)](https://beartype.readthedocs.io)
9
+
10
+ `xwr` is a pure-python, linux-based real time raw data capture system for TI mmWave radars, and includes four key components:
11
+
12
+ - [`xwr`](https://radarml.github.io/xwr/system/): a high-level data capture interface
13
+ - [`xwr.rsp`](https://radarml.github.io/xwr/rsp/rsp/): a radar signal processing library with Numpy, Pytorch, and Jax support
14
+ - [`xwr.radar`](https://radarml.github.io/xwr/radar/api/): a parameterized python interface for the default radar firmware
15
+ - [`xwr.capture`](https://radarml.github.io/xwr/dca/api/): a pure-python, real-time interface for the DCA1000EVM
16
+
17
+ See our [documentation site](https://radarml.github.io/xwr/) for more details, setup guides, the included demo, and more!
18
+
19
+ ## Requirements
20
+
21
+ `xwr` assumes a linux-based system and radar hardware which consists of the DCA1000EVM and a supported TI mmWave Radar (XWR) development board.
22
+
23
+ > [!IMPORTANT]
24
+ > Supported Devices:
25
+ > - AWR1843 Family: AWR1843Boost, AWR1843AOPEVM
26
+ > - AWR1642
27
+ >
28
+ > WIP:
29
+ > - AWR2544LOPEVM
30
+
31
+ ## Install
32
+
33
+ The `xwr` library is currently only distributed via github:
34
+
35
+ ```sh
36
+ # Install directly from github
37
+ pip install git+ssh://github.com/RadarML/xwr.git
38
+ ```
@@ -0,0 +1,19 @@
1
+ # This can be passed to `AWRSystem` by simply unpacking:
2
+ # system = AWRSystem(**config)
3
+ radar: # -> AWRConfig
4
+ port: null # auto-detect
5
+ frequency: 77.0
6
+ idle_time: 200.0
7
+ adc_start_time: 5.7
8
+ ramp_end_time: 59.00
9
+ tx_start_time: 1.0
10
+ freq_slope: 67.012
11
+ adc_samples: 128
12
+ sample_rate: 2500
13
+ frame_length: 128
14
+ frame_period: 125.0
15
+ capture: # -> DCAConfig
16
+ sys_ip: 192.168.33.30
17
+ fpga_ip: 192.168.33.180
18
+ data_port: 4098
19
+ config_port: 4096
xwr-0.3.2/demo/demo.py ADDED
@@ -0,0 +1,94 @@
1
+ """Simple range-doppler and range-azimuth visualization demo."""
2
+
3
+ import logging
4
+ import os
5
+
6
+ import numpy as np
7
+ import tyro
8
+ import yaml
9
+ from matplotlib import pyplot as plt
10
+ from rich.logging import RichHandler
11
+
12
+ import xwr
13
+ from xwr.rsp import numpy as xwr_rsp
14
+
15
+
16
+ def cli_main(
17
+ config: str | None = None,
18
+ rsp: str = "AWR1843Boost",
19
+ device: str | None = None,
20
+ verbose: int = 20,
21
+ ):
22
+ """Range-doppler visualization demo.
23
+
24
+ Using the default configuration, you will need to set the `device` field
25
+ and `rsp` field to match your radar. For example:
26
+
27
+ - AWR1843Boost: --device AWR1843 --rsp AWR1843Boost
28
+ - AWR1843AOPEVM: --device AWR1843 --rsp AWR1843AOP
29
+ - AWR1642Boost: --device AWR1642 --rsp AWR1642Boost
30
+
31
+ Args:
32
+ config: path to configuration file. If not provided, defaults to the
33
+ included `config.yaml`.
34
+ rsp: radar signal processing class to use; is responsible for handling
35
+ the virtual antenna array for angular spectrum computation.
36
+ device: optional device name; if provided, overrides (or sets) the
37
+ radar `device` field in the configuration file.
38
+ verbose: logging verbosity level (10-debug; 20-info; 30-warning;
39
+ 40-error).
40
+ """
41
+ logging.basicConfig(
42
+ level=verbose, format="%(name)-12s %(message)s", datefmt="[%H:%M:%S]",
43
+ handlers=[RichHandler()])
44
+ log = logging.getLogger("XWRDemo")
45
+
46
+ if config is None:
47
+ config = os.path.join(os.path.dirname(__file__), "config.yaml")
48
+
49
+ with open(config) as f:
50
+ cfg = yaml.safe_load(f)
51
+ if device is not None:
52
+ cfg["radar"]["device"] = device
53
+
54
+ # Create a figure
55
+ plt.ion() # Enable interactive mode
56
+ fig, axs = plt.subplots(1, 2)
57
+
58
+ im1 = axs[0].imshow(
59
+ np.zeros((128, 128), dtype=np.float32),
60
+ cmap="viridis", aspect='auto', origin='lower')
61
+ im2 = axs[1].imshow(
62
+ np.zeros((128, 128), dtype=np.float32),
63
+ cmap="viridis", aspect='auto', origin='lower')
64
+
65
+ axs[0].set_xlabel("Doppler")
66
+ axs[0].set_ylabel("Range")
67
+ axs[1].set_xlabel("Azimuth")
68
+ axs[1].set_ylabel("Range")
69
+ fig.tight_layout()
70
+
71
+ awr = xwr.XWRSystem(**cfg)
72
+ rsp_inst = getattr(xwr_rsp, rsp)(window=False, size={"azimuth": 128})
73
+
74
+ try:
75
+ for frame in awr.dstream(numpy=True):
76
+ # batch doppler elevation azimuth range
77
+ dear = np.abs(rsp_inst(frame[None, ...]))
78
+ rd = np.swapaxes(np.mean(dear, axis=(0, 2, 3)), 0, 1)
79
+ ra = np.swapaxes(np.mean(dear, axis=(0, 1, 2)), 0, 1)
80
+
81
+ im1.set_data(rd)
82
+ im1.set_clim(vmin=np.min(rd), vmax=np.max(rd))
83
+ im2.set_data(ra)
84
+ im2.set_clim(vmin=np.min(ra), vmax=np.max(ra))
85
+
86
+ # Needed to update the figure
87
+ plt.pause(0.001)
88
+
89
+ except KeyboardInterrupt:
90
+ log.warning("Demo interrupted by user.")
91
+ awr.stop()
92
+
93
+ if __name__ == "__main__":
94
+ tyro.cli(cli_main)
@@ -0,0 +1 @@
1
+ ::: xwr.capture
@@ -0,0 +1 @@
1
+ ::: xwr.capture.defines
@@ -0,0 +1 @@
1
+ ::: xwr.capture.types
@@ -0,0 +1,70 @@
1
+ # Development Environment
2
+
3
+ !!! info "`xwr` uses `uv`"
4
+
5
+ While `pyproject.toml` reflects known limitations on dependency versions, we use `uv` to manage a lock file used for development.
6
+
7
+ On a fresh linux install, you will need to [install `uv`](https://docs.astral.sh/uv/getting-started/installation/):
8
+ ```sh
9
+ curl -LsSf https://astral.sh/uv/install.sh | sh
10
+ source ~/.bashrc
11
+ ```
12
+
13
+ ## Setup
14
+
15
+ Set up fresh development machine:
16
+ ```sh
17
+ sudo apt-get install -y openssh-server git curl
18
+ curl -LsSf https://astral.sh/uv/install.sh | sh
19
+ source ~/.bashrc
20
+
21
+ ssh-keygen
22
+ # (add ssh key or add deploy key to xwr)
23
+ git clone git@github.com:WiseLabCMU/xwr.git
24
+ ```
25
+
26
+ Set up development environment:
27
+ ```sh
28
+ uv sync --all-extras --frozen
29
+ uv run pre-commit install
30
+ ```
31
+
32
+ !!! warning
33
+
34
+ This will install all backends (numpy, pytorch, and jax), which is necessary for static type checking and backend-specific tests. If you are only working on the interface, you can skip `--all-extras`.
35
+
36
+ ## Tests
37
+
38
+ Run tests:
39
+ ```sh
40
+ uv run --all-extras pytest -ra --cov --cov-report=html --cov-report=term -- tests
41
+ ```
42
+
43
+ !!! tip
44
+
45
+ HTML-format code coverage is saved to `./htmlcov`; view these with `cd htmlcov; python -m http.server 8001`.
46
+
47
+ Run tests (including data capture):
48
+ ```sh
49
+ export XWR_DEVICE=AWR1843
50
+ uv run --all-extras pytest -ra --cov --cov-report=html --cov-report=term -- tests
51
+ ```
52
+
53
+ - A radar and capture card should be configured and connected to the test computer.
54
+ - Set `XWR_DEVICE` to the name of the radar (i.e., a class name in [`xwr.radar`][xwr.radar]).
55
+ - If `XWR_DEVICE` is not set, all capture-related tests will be skipped.
56
+
57
+ !!! info
58
+
59
+ The tests are also run by our [pre-commit](https://pre-commit.com/) hooks, which you can manually trigger with `uv run pre-commit run`; these hooks (`ruff + pyright + pytest`) mirror the CI.
60
+
61
+ ## Docs
62
+
63
+ Build docs for development:
64
+ ```sh
65
+ uv run --extra docs mkdocs serve
66
+ ```
67
+
68
+ !!! info
69
+
70
+ The [documentation site](https://radarml.github.io/xwr) is automatically built and deployed via GitHub Actions when a PR is merged.
Binary file
Binary file
Binary file
Binary file
Binary file