depz-sensor-sdk 0.1.0__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 (71) hide show
  1. depz_sensor_sdk-0.1.0/NOTICE +6 -0
  2. depz_sensor_sdk-0.1.0/PKG-INFO +76 -0
  3. depz_sensor_sdk-0.1.0/README.md +48 -0
  4. depz_sensor_sdk-0.1.0/depz_sensor_sdk/__init__.py +110 -0
  5. depz_sensor_sdk-0.1.0/depz_sensor_sdk/bno086/__init__.py +661 -0
  6. depz_sensor_sdk-0.1.0/depz_sensor_sdk/bno086/reports.py +598 -0
  7. depz_sensor_sdk-0.1.0/depz_sensor_sdk/bno086/sh2.py +558 -0
  8. depz_sensor_sdk-0.1.0/depz_sensor_sdk/bno086/shtp.py +183 -0
  9. depz_sensor_sdk-0.1.0/depz_sensor_sdk/bootloader.py +271 -0
  10. depz_sensor_sdk-0.1.0/depz_sensor_sdk/cli.py +237 -0
  11. depz_sensor_sdk-0.1.0/depz_sensor_sdk/dataset.py +260 -0
  12. depz_sensor_sdk-0.1.0/depz_sensor_sdk/device.py +582 -0
  13. depz_sensor_sdk-0.1.0/depz_sensor_sdk/discovery.py +313 -0
  14. depz_sensor_sdk-0.1.0/depz_sensor_sdk/errors.py +68 -0
  15. depz_sensor_sdk-0.1.0/depz_sensor_sdk/protocol/__init__.py +39 -0
  16. depz_sensor_sdk-0.1.0/depz_sensor_sdk/protocol/bno086.py +44 -0
  17. depz_sensor_sdk-0.1.0/depz_sensor_sdk/protocol/bootloader.py +125 -0
  18. depz_sensor_sdk-0.1.0/depz_sensor_sdk/protocol/common.py +164 -0
  19. depz_sensor_sdk-0.1.0/depz_sensor_sdk/protocol/identity.py +49 -0
  20. depz_sensor_sdk-0.1.0/depz_sensor_sdk/protocol/sr04.py +71 -0
  21. depz_sensor_sdk-0.1.0/depz_sensor_sdk/protocol/vl53l8.py +111 -0
  22. depz_sensor_sdk-0.1.0/depz_sensor_sdk/sr04.py +142 -0
  23. depz_sensor_sdk-0.1.0/depz_sensor_sdk/transport/__init__.py +35 -0
  24. depz_sensor_sdk-0.1.0/depz_sensor_sdk/transport/crc.py +62 -0
  25. depz_sensor_sdk-0.1.0/depz_sensor_sdk/transport/framing.py +149 -0
  26. depz_sensor_sdk-0.1.0/depz_sensor_sdk/transport/link.py +81 -0
  27. depz_sensor_sdk-0.1.0/depz_sensor_sdk/transport/record_replay.py +160 -0
  28. depz_sensor_sdk-0.1.0/depz_sensor_sdk/transport/serial_link.py +60 -0
  29. depz_sensor_sdk-0.1.0/depz_sensor_sdk/usb_ids.py +74 -0
  30. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/__init__.py +494 -0
  31. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/cnh.py +283 -0
  32. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/ch/default_configuration.bin +0 -0
  33. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/ch/default_xtalk.bin +0 -0
  34. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/ch/firmware.bin +0 -0
  35. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/ch/get_nvm_cmd.bin +0 -0
  36. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/cx/default_configuration.bin +0 -0
  37. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/cx/default_xtalk.bin +0 -0
  38. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/cx/firmware.bin +0 -0
  39. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/data/cx/get_nvm_cmd.bin +0 -0
  40. depz_sensor_sdk-0.1.0/depz_sensor_sdk/vl53l8/uld.py +1288 -0
  41. depz_sensor_sdk-0.1.0/depz_sensor_sdk.egg-info/PKG-INFO +76 -0
  42. depz_sensor_sdk-0.1.0/depz_sensor_sdk.egg-info/SOURCES.txt +69 -0
  43. depz_sensor_sdk-0.1.0/depz_sensor_sdk.egg-info/dependency_links.txt +1 -0
  44. depz_sensor_sdk-0.1.0/depz_sensor_sdk.egg-info/entry_points.txt +2 -0
  45. depz_sensor_sdk-0.1.0/depz_sensor_sdk.egg-info/requires.txt +2 -0
  46. depz_sensor_sdk-0.1.0/depz_sensor_sdk.egg-info/top_level.txt +1 -0
  47. depz_sensor_sdk-0.1.0/pyproject.toml +44 -0
  48. depz_sensor_sdk-0.1.0/setup.cfg +4 -0
  49. depz_sensor_sdk-0.1.0/tests/test_bno086.py +294 -0
  50. depz_sensor_sdk-0.1.0/tests/test_bno086_commands.py +111 -0
  51. depz_sensor_sdk-0.1.0/tests/test_bno086_reports.py +283 -0
  52. depz_sensor_sdk-0.1.0/tests/test_bootloader.py +144 -0
  53. depz_sensor_sdk-0.1.0/tests/test_dataset.py +113 -0
  54. depz_sensor_sdk-0.1.0/tests/test_device_core.py +150 -0
  55. depz_sensor_sdk-0.1.0/tests/test_discovery.py +173 -0
  56. depz_sensor_sdk-0.1.0/tests/test_multi_device.py +138 -0
  57. depz_sensor_sdk-0.1.0/tests/test_record_replay.py +48 -0
  58. depz_sensor_sdk-0.1.0/tests/test_sr04_coverage.py +174 -0
  59. depz_sensor_sdk-0.1.0/tests/test_vectors_bno086.py +109 -0
  60. depz_sensor_sdk-0.1.0/tests/test_vectors_common.py +53 -0
  61. depz_sensor_sdk-0.1.0/tests/test_vectors_crc.py +22 -0
  62. depz_sensor_sdk-0.1.0/tests/test_vectors_framing.py +70 -0
  63. depz_sensor_sdk-0.1.0/tests/test_vectors_fwdepz.py +20 -0
  64. depz_sensor_sdk-0.1.0/tests/test_vectors_identity.py +13 -0
  65. depz_sensor_sdk-0.1.0/tests/test_vectors_sr04.py +34 -0
  66. depz_sensor_sdk-0.1.0/tests/test_vectors_usb_ids.py +18 -0
  67. depz_sensor_sdk-0.1.0/tests/test_vectors_vl53l8_advanced.py +37 -0
  68. depz_sensor_sdk-0.1.0/tests/test_vl53l8_advanced.py +131 -0
  69. depz_sensor_sdk-0.1.0/tests/test_vl53l8_bugs.py +52 -0
  70. depz_sensor_sdk-0.1.0/tests/test_vl53l8_config.py +188 -0
  71. depz_sensor_sdk-0.1.0/tests/test_vl53l8_replay.py +55 -0
@@ -0,0 +1,6 @@
1
+ depz-sensor-sdk bundles VL53L8CX/CH sensor-firmware and configuration blobs
2
+ (depz_sensor_sdk/vl53l8/data/{cx,ch}/*.bin) that are © STMicroelectronics,
3
+ distributed under the BSD-3-Clause license (from the ST VL53L8CX ULD).
4
+ The VL53L8 host-side ULD port and its advanced plugins (detection thresholds,
5
+ xtalk, motion indicator) are derived from the ST VL53L8CX ULD (BSD-3-Clause,
6
+ stm32duino/VL53L8CX). All other code is © DEPZ, MIT.
@@ -0,0 +1,76 @@
1
+ Metadata-Version: 2.4
2
+ Name: depz-sensor-sdk
3
+ Version: 0.1.0
4
+ Summary: Python SDK for the DEPZ USB sensor line — HC-SR04 ultrasonic, VL53L8CX/CH 8x8 ToF, BNO086 IMU.
5
+ Author: DEPZ
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/depz-ai/depz-sensor-sdk-and-viewer
8
+ Project-URL: Repository, https://github.com/depz-ai/depz-sensor-sdk-and-viewer
9
+ Keywords: depz,sensor,usb,cdc,vl53l8,bno086,hc-sr04,tof,imu,ultrasonic
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: System :: Hardware :: Hardware Drivers
21
+ Classifier: Intended Audience :: Developers
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: NOTICE
25
+ Requires-Dist: pyserial>=3.5
26
+ Requires-Dist: numpy>=1.24
27
+ Dynamic: license-file
28
+
29
+ # depz-sensor-sdk
30
+
31
+ Python SDK for the **DEPZ USB sensor line** — three USB CDC-ACM sensors that
32
+ speak one shared framed protocol:
33
+
34
+ - **HC-SR04** — ultrasonic distance
35
+ - **VL53L8CX / VL53L8CH** — 8×8 multizone Time-of-Flight (host runs the ST ULD)
36
+ - **BNO086** — 9-axis IMU (host runs the SH-2 stack)
37
+
38
+ Sync API with a background reader thread: open a device, configure it, consume
39
+ a stream of decoded, timestamped results. A TypeScript SDK
40
+ ([`@depz/sensor-sdk`](https://www.npmjs.com/package/@depz/sensor-sdk)) mirrors
41
+ this one byte-for-byte via shared golden test vectors.
42
+
43
+ ## Install
44
+
45
+ ```bash
46
+ pip install depz-sensor-sdk
47
+ ```
48
+
49
+ Linux: your user needs serial access (group `dialout`); `ModemManager` can
50
+ grab CDC-ACM ports — disable it or add a udev rule if opens time out.
51
+
52
+ ## Quick start
53
+
54
+ ```python
55
+ from depz_sensor_sdk import open_device
56
+ from depz_sensor_sdk.vl53l8 import Vl53l8Cx, RESOLUTION_8X8
57
+
58
+ dev = open_device() # first DEPZ sensor by USB id; raises if none
59
+ if isinstance(dev, Vl53l8Cx):
60
+ dev.init(progress=print) # ~25 s: downloads the sensor firmware
61
+ dev.set_resolution(RESOLUTION_8X8)
62
+ dev.set_ranging_frequency_hz(15) # must be >= 2 Hz
63
+ dev.start_ranging()
64
+ for frame in dev.frames():
65
+ print(frame.grid()) # 8×8 numpy array of mm
66
+ ```
67
+
68
+ `open_device()` finds the device by USB VID/PID; pass a serial (`open_device(serial="...")`),
69
+ an index, or an explicit port. `depz-sensor list` shows what's connected.
70
+
71
+ See `docs/guide.md` for the full guide and `docs/api.md` for the API reference.
72
+
73
+ ## License
74
+
75
+ MIT. Bundled VL53L8 sensor-firmware blobs are © STMicroelectronics
76
+ (BSD-3-Clause); see `NOTICE`.
@@ -0,0 +1,48 @@
1
+ # depz-sensor-sdk
2
+
3
+ Python SDK for the **DEPZ USB sensor line** — three USB CDC-ACM sensors that
4
+ speak one shared framed protocol:
5
+
6
+ - **HC-SR04** — ultrasonic distance
7
+ - **VL53L8CX / VL53L8CH** — 8×8 multizone Time-of-Flight (host runs the ST ULD)
8
+ - **BNO086** — 9-axis IMU (host runs the SH-2 stack)
9
+
10
+ Sync API with a background reader thread: open a device, configure it, consume
11
+ a stream of decoded, timestamped results. A TypeScript SDK
12
+ ([`@depz/sensor-sdk`](https://www.npmjs.com/package/@depz/sensor-sdk)) mirrors
13
+ this one byte-for-byte via shared golden test vectors.
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ pip install depz-sensor-sdk
19
+ ```
20
+
21
+ Linux: your user needs serial access (group `dialout`); `ModemManager` can
22
+ grab CDC-ACM ports — disable it or add a udev rule if opens time out.
23
+
24
+ ## Quick start
25
+
26
+ ```python
27
+ from depz_sensor_sdk import open_device
28
+ from depz_sensor_sdk.vl53l8 import Vl53l8Cx, RESOLUTION_8X8
29
+
30
+ dev = open_device() # first DEPZ sensor by USB id; raises if none
31
+ if isinstance(dev, Vl53l8Cx):
32
+ dev.init(progress=print) # ~25 s: downloads the sensor firmware
33
+ dev.set_resolution(RESOLUTION_8X8)
34
+ dev.set_ranging_frequency_hz(15) # must be >= 2 Hz
35
+ dev.start_ranging()
36
+ for frame in dev.frames():
37
+ print(frame.grid()) # 8×8 numpy array of mm
38
+ ```
39
+
40
+ `open_device()` finds the device by USB VID/PID; pass a serial (`open_device(serial="...")`),
41
+ an index, or an explicit port. `depz-sensor list` shows what's connected.
42
+
43
+ See `docs/guide.md` for the full guide and `docs/api.md` for the API reference.
44
+
45
+ ## License
46
+
47
+ MIT. Bundled VL53L8 sensor-firmware blobs are © STMicroelectronics
48
+ (BSD-3-Clause); see `NOTICE`.
@@ -0,0 +1,110 @@
1
+ """DEPZ sensor line SDK — SR04, VL53L8CX/CH, BNO086 over USB CDC-ACM.
2
+
3
+ Public surface is defined by contracts/07_SDK_FACADE.md.
4
+ """
5
+
6
+ from . import transport, protocol
7
+ from .device import (
8
+ DeviceBase,
9
+ DeviceEvent,
10
+ DisconnectedEvent,
11
+ LinkCrcErrorEvent,
12
+ LinkStats,
13
+ SequenceErrorEvent,
14
+ StreamQueue,
15
+ TemperatureEvent,
16
+ TextEvent,
17
+ TimeSync,
18
+ TrashEvent,
19
+ UnsolicitedStatusEvent,
20
+ host_now_us,
21
+ sync_time_all,
22
+ )
23
+ from .bootloader import BootloaderDevice, find_bootloader_port, update_firmware
24
+ from .dataset import DatasetReader, DatasetRecord, SessionRecorder
25
+ from .protocol.bootloader import FwDepzImage
26
+ from .device import StreamIterator
27
+ from .discovery import DeviceInfo, list_depz_devices, open_device, probe_port
28
+ from .vl53l8 import CnhConfig, Vl53l8, Vl53l8Ch, Vl53l8Cx, Vl53l8Frame
29
+ from .errors import (
30
+ BusyError,
31
+ DepzError,
32
+ DepzTimeoutError,
33
+ DeviceLostError,
34
+ LinkClosedError,
35
+ NoDepzDeviceError,
36
+ StatusError,
37
+ )
38
+ from .usb_ids import (
39
+ DEPZ_USB_VID,
40
+ DEPZ_PID_MODEL,
41
+ is_known_depz_usb,
42
+ usb_model_hint,
43
+ )
44
+ from .sr04 import Sr04, Sr04Measurement
45
+ from .bno086 import Bno086, GyroIntegratedRV, RotationVector, SensorId
46
+
47
+ __version__ = "0.1.0"
48
+
49
+ __all__ = [
50
+ # modules
51
+ "transport",
52
+ "protocol",
53
+ # discovery
54
+ "DeviceInfo",
55
+ "list_depz_devices",
56
+ "probe_port",
57
+ "open_device",
58
+ # usb identity table
59
+ "DEPZ_USB_VID",
60
+ "DEPZ_PID_MODEL",
61
+ "is_known_depz_usb",
62
+ "usb_model_hint",
63
+ # device
64
+ "DeviceBase",
65
+ "TimeSync",
66
+ "LinkStats",
67
+ "StreamQueue",
68
+ "host_now_us",
69
+ "sync_time_all",
70
+ # events
71
+ "DeviceEvent",
72
+ "SequenceErrorEvent",
73
+ "LinkCrcErrorEvent",
74
+ "TrashEvent",
75
+ "UnsolicitedStatusEvent",
76
+ "TextEvent",
77
+ "TemperatureEvent",
78
+ "DisconnectedEvent",
79
+ # sensors
80
+ "Sr04",
81
+ "Sr04Measurement",
82
+ "Vl53l8",
83
+ "Vl53l8Cx",
84
+ "Vl53l8Ch",
85
+ "Vl53l8Frame",
86
+ "CnhConfig",
87
+ "Bno086",
88
+ "SensorId",
89
+ "RotationVector",
90
+ "GyroIntegratedRV",
91
+ "StreamIterator",
92
+ # datasets (contract 09)
93
+ "SessionRecorder",
94
+ "DatasetReader",
95
+ "DatasetRecord",
96
+ # bootloader / firmware update (contract 06)
97
+ "BootloaderDevice",
98
+ "FwDepzImage",
99
+ "update_firmware",
100
+ "find_bootloader_port",
101
+ # errors
102
+ "DepzError",
103
+ "DepzTimeoutError",
104
+ "StatusError",
105
+ "BusyError",
106
+ "DeviceLostError",
107
+ "LinkClosedError",
108
+ "NoDepzDeviceError",
109
+ "__version__",
110
+ ]