@depz/sensor-sdk 0.1.0
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.
- package/README.md +69 -0
- package/dist/dataset.d.ts +93 -0
- package/dist/dataset.d.ts.map +1 -0
- package/dist/dataset.js +253 -0
- package/dist/dataset.js.map +1 -0
- package/dist/device/device.d.ts +185 -0
- package/dist/device/device.d.ts.map +1 -0
- package/dist/device/device.js +421 -0
- package/dist/device/device.js.map +1 -0
- package/dist/device/link.d.ts +62 -0
- package/dist/device/link.d.ts.map +1 -0
- package/dist/device/link.js +130 -0
- package/dist/device/link.js.map +1 -0
- package/dist/discovery.d.ts +109 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +281 -0
- package/dist/discovery.js.map +1 -0
- package/dist/errors.d.ts +39 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +69 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol/bno086.d.ts +36 -0
- package/dist/protocol/bno086.d.ts.map +1 -0
- package/dist/protocol/bno086.js +38 -0
- package/dist/protocol/bno086.js.map +1 -0
- package/dist/protocol/common.d.ts +103 -0
- package/dist/protocol/common.d.ts.map +1 -0
- package/dist/protocol/common.js +121 -0
- package/dist/protocol/common.js.map +1 -0
- package/dist/protocol/crc.d.ts +17 -0
- package/dist/protocol/crc.d.ts.map +1 -0
- package/dist/protocol/crc.js +55 -0
- package/dist/protocol/crc.js.map +1 -0
- package/dist/protocol/framing.d.ts +65 -0
- package/dist/protocol/framing.d.ts.map +1 -0
- package/dist/protocol/framing.js +152 -0
- package/dist/protocol/framing.js.map +1 -0
- package/dist/protocol/fwdepz.d.ts +21 -0
- package/dist/protocol/fwdepz.d.ts.map +1 -0
- package/dist/protocol/fwdepz.js +46 -0
- package/dist/protocol/fwdepz.js.map +1 -0
- package/dist/protocol/identity.d.ts +14 -0
- package/dist/protocol/identity.d.ts.map +1 -0
- package/dist/protocol/identity.js +28 -0
- package/dist/protocol/identity.js.map +1 -0
- package/dist/protocol/sr04.d.ts +38 -0
- package/dist/protocol/sr04.d.ts.map +1 -0
- package/dist/protocol/sr04.js +58 -0
- package/dist/protocol/sr04.js.map +1 -0
- package/dist/protocol/usb-ids.d.ts +60 -0
- package/dist/protocol/usb-ids.d.ts.map +1 -0
- package/dist/protocol/usb-ids.js +79 -0
- package/dist/protocol/usb-ids.js.map +1 -0
- package/dist/protocol/vl53l8.d.ts +59 -0
- package/dist/protocol/vl53l8.d.ts.map +1 -0
- package/dist/protocol/vl53l8.js +116 -0
- package/dist/protocol/vl53l8.js.map +1 -0
- package/dist/sensors/bno086/bno086.d.ts +197 -0
- package/dist/sensors/bno086/bno086.d.ts.map +1 -0
- package/dist/sensors/bno086/bno086.js +543 -0
- package/dist/sensors/bno086/bno086.js.map +1 -0
- package/dist/sensors/bno086/reports.d.ts +289 -0
- package/dist/sensors/bno086/reports.d.ts.map +1 -0
- package/dist/sensors/bno086/reports.js +397 -0
- package/dist/sensors/bno086/reports.js.map +1 -0
- package/dist/sensors/bno086/sh2.d.ts +307 -0
- package/dist/sensors/bno086/sh2.d.ts.map +1 -0
- package/dist/sensors/bno086/sh2.js +480 -0
- package/dist/sensors/bno086/sh2.js.map +1 -0
- package/dist/sensors/bno086/shtp.d.ts +98 -0
- package/dist/sensors/bno086/shtp.d.ts.map +1 -0
- package/dist/sensors/bno086/shtp.js +205 -0
- package/dist/sensors/bno086/shtp.js.map +1 -0
- package/dist/sensors/sr04.d.ts +65 -0
- package/dist/sensors/sr04.d.ts.map +1 -0
- package/dist/sensors/sr04.js +121 -0
- package/dist/sensors/sr04.js.map +1 -0
- package/dist/sensors/vl53l8/assets/ch.d.ts +16 -0
- package/dist/sensors/vl53l8/assets/ch.d.ts.map +1 -0
- package/dist/sensors/vl53l8/assets/ch.js +22 -0
- package/dist/sensors/vl53l8/assets/ch.js.map +1 -0
- package/dist/sensors/vl53l8/assets/cx.d.ts +16 -0
- package/dist/sensors/vl53l8/assets/cx.d.ts.map +1 -0
- package/dist/sensors/vl53l8/assets/cx.js +22 -0
- package/dist/sensors/vl53l8/assets/cx.js.map +1 -0
- package/dist/sensors/vl53l8/assets/decode.d.ts +7 -0
- package/dist/sensors/vl53l8/assets/decode.d.ts.map +1 -0
- package/dist/sensors/vl53l8/assets/decode.js +35 -0
- package/dist/sensors/vl53l8/assets/decode.js.map +1 -0
- package/dist/sensors/vl53l8/assets/index.d.ts +19 -0
- package/dist/sensors/vl53l8/assets/index.d.ts.map +1 -0
- package/dist/sensors/vl53l8/assets/index.js +11 -0
- package/dist/sensors/vl53l8/assets/index.js.map +1 -0
- package/dist/sensors/vl53l8/cnh.d.ts +113 -0
- package/dist/sensors/vl53l8/cnh.d.ts.map +1 -0
- package/dist/sensors/vl53l8/cnh.js +299 -0
- package/dist/sensors/vl53l8/cnh.js.map +1 -0
- package/dist/sensors/vl53l8/uld.d.ts +346 -0
- package/dist/sensors/vl53l8/uld.d.ts.map +1 -0
- package/dist/sensors/vl53l8/uld.js +1388 -0
- package/dist/sensors/vl53l8/uld.js.map +1 -0
- package/dist/sensors/vl53l8/vl53l8.d.ts +182 -0
- package/dist/sensors/vl53l8/vl53l8.d.ts.map +1 -0
- package/dist/sensors/vl53l8/vl53l8.js +411 -0
- package/dist/sensors/vl53l8/vl53l8.js.map +1 -0
- package/dist/transport/loopback.d.ts +18 -0
- package/dist/transport/loopback.d.ts.map +1 -0
- package/dist/transport/loopback.js +53 -0
- package/dist/transport/loopback.js.map +1 -0
- package/dist/transport/node.d.ts +51 -0
- package/dist/transport/node.d.ts.map +1 -0
- package/dist/transport/node.js +123 -0
- package/dist/transport/node.js.map +1 -0
- package/dist/transport/replay.d.ts +68 -0
- package/dist/transport/replay.d.ts.map +1 -0
- package/dist/transport/replay.js +196 -0
- package/dist/transport/replay.js.map +1 -0
- package/dist/transport/types.d.ts +23 -0
- package/dist/transport/types.d.ts.map +1 -0
- package/dist/transport/types.js +7 -0
- package/dist/transport/types.js.map +1 -0
- package/dist/transport/webserial.d.ts +69 -0
- package/dist/transport/webserial.d.ts.map +1 -0
- package/dist/transport/webserial.js +196 -0
- package/dist/transport/webserial.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VL53L8CX/CH ToF sensor: host-side ULD over the firmware register bridge.
|
|
3
|
+
*
|
|
4
|
+
* The MCU is a thin SPI bridge (contracts/04): the full ST ULD driver runs
|
|
5
|
+
* here on the host (`uld.ts`). Frame streaming is INT-driven push from the
|
|
6
|
+
* device, reassembled from ≤1528-byte chunks.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors the Python reference `depz_sensor_sdk.vl53l8.Vl53l8`.
|
|
9
|
+
*/
|
|
10
|
+
import { DepzDevice, StreamQueue } from "../../device/device.js";
|
|
11
|
+
import { DepzError, DepzTimeoutError } from "../../errors.js";
|
|
12
|
+
import { CHUNK_SIZE, FrameReassembler, Vl53l8Cmd, Vl53l8Rpt, packReadReg, packStartStream, packWriteReg, unpackFrameChunk, unpackRegData, } from "../../protocol/vl53l8.js";
|
|
13
|
+
import { loadAssets } from "./assets/index.js";
|
|
14
|
+
import { MI_CFG_DEV_IDX } from "./cnh.js";
|
|
15
|
+
import { RESOLUTION_4X4, RESOLUTION_8X8, VL53L8CX, Vl53l8cxError, readDeviceRevisionId, } from "./uld.js";
|
|
16
|
+
/** Below this the sensor never streams (contract 04). */
|
|
17
|
+
export const MIN_RANGING_FREQUENCY_HZ = 2;
|
|
18
|
+
/** Zone array reshaped to (4,4) or (8,8) — mirror of Vl53l8Frame.grid(). */
|
|
19
|
+
export function zoneGrid(arr, resolution) {
|
|
20
|
+
const side = resolution === RESOLUTION_4X4 ? 4 : 8;
|
|
21
|
+
const rows = [];
|
|
22
|
+
for (let r = 0; r < side; r++) {
|
|
23
|
+
const row = [];
|
|
24
|
+
for (let c = 0; c < side; c++)
|
|
25
|
+
row.push(arr[r * side + c] ?? 0);
|
|
26
|
+
rows.push(row);
|
|
27
|
+
}
|
|
28
|
+
return rows;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* VL53L8CX ToF device: `init()` downloads the ~84 KB sensor firmware (takes a
|
|
32
|
+
* few seconds over CDC), then configure and `startRanging()`.
|
|
33
|
+
*
|
|
34
|
+
* This is the base class for both silicon variants. The VL53L8CH superset
|
|
35
|
+
* (compact-network-histogram output) lives in `Vl53l8Ch`, which inherits every
|
|
36
|
+
* method here. All configuration methods require `init()` first and must not
|
|
37
|
+
* be called while ranging (the ULD talks to the current register bank; the
|
|
38
|
+
* stream owns it — contract 04).
|
|
39
|
+
*/
|
|
40
|
+
export class Vl53l8Cx extends DepzDevice {
|
|
41
|
+
/** Sensor-firmware blob variant this class loads. */
|
|
42
|
+
variantId = "cx";
|
|
43
|
+
uldDriver = null;
|
|
44
|
+
reassembler = new FrameReassembler();
|
|
45
|
+
frameCbs = [];
|
|
46
|
+
frameQueues = [];
|
|
47
|
+
rangingFlag = false;
|
|
48
|
+
cnhConfig = null;
|
|
49
|
+
writeProgressCb = null;
|
|
50
|
+
resolution = RESOLUTION_4X4; // ULD default after init
|
|
51
|
+
sleepImpl;
|
|
52
|
+
/** ULD `platform` object mapped onto the firmware register bridge. */
|
|
53
|
+
platform = {
|
|
54
|
+
rdMulti: async (addr, size) => {
|
|
55
|
+
const out = new Uint8Array(size);
|
|
56
|
+
let off = 0;
|
|
57
|
+
while (size > 0) {
|
|
58
|
+
const n = Math.min(size, CHUNK_SIZE);
|
|
59
|
+
const rep = await this.request(Vl53l8Cmd.ReadReg, packReadReg(addr, n), {
|
|
60
|
+
matcher: DepzDevice.expectReport(Vl53l8Rpt.RegData, unpackRegData),
|
|
61
|
+
timeoutMs: 2000,
|
|
62
|
+
});
|
|
63
|
+
if (rep.data.length !== n) {
|
|
64
|
+
throw new DepzError(`READ_REG 0x${addr.toString(16).toUpperCase().padStart(4, "0")}: ` +
|
|
65
|
+
`expected ${n}, got ${rep.data.length}`);
|
|
66
|
+
}
|
|
67
|
+
out.set(rep.data, off);
|
|
68
|
+
off += n;
|
|
69
|
+
addr += n;
|
|
70
|
+
size -= n;
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
},
|
|
74
|
+
wrMulti: async (addr, data) => {
|
|
75
|
+
let done = 0;
|
|
76
|
+
while (done < data.length) {
|
|
77
|
+
const chunk = data.subarray(done, done + CHUNK_SIZE);
|
|
78
|
+
await this.request(Vl53l8Cmd.WriteReg, packWriteReg(addr, chunk), {
|
|
79
|
+
okCompletes: true,
|
|
80
|
+
timeoutMs: 2000,
|
|
81
|
+
});
|
|
82
|
+
addr += chunk.length;
|
|
83
|
+
done += chunk.length;
|
|
84
|
+
if (this.writeProgressCb !== null && data.length > CHUNK_SIZE) {
|
|
85
|
+
this.writeProgressCb(done, data.length);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
sleepMs: (ms) => this.sleepImpl(ms),
|
|
90
|
+
};
|
|
91
|
+
constructor(transport, opts) {
|
|
92
|
+
super(transport, opts);
|
|
93
|
+
this.sleepImpl = opts?.sleepImpl ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
94
|
+
}
|
|
95
|
+
// ── lifecycle ──────────────────────────────────────────────────────────────
|
|
96
|
+
/** The underlying ULD driver (escape hatch for advanced DCI access). */
|
|
97
|
+
get uld() {
|
|
98
|
+
if (this.uldDriver === null)
|
|
99
|
+
throw new DepzError("call init() first");
|
|
100
|
+
return this.uldDriver;
|
|
101
|
+
}
|
|
102
|
+
/** 'cx' | 'ch' (valid after init()). */
|
|
103
|
+
get variant() {
|
|
104
|
+
return this.uld.variant;
|
|
105
|
+
}
|
|
106
|
+
async isAlive() {
|
|
107
|
+
try {
|
|
108
|
+
await readDeviceRevisionId(this.platform);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
if (err instanceof Vl53l8cxError || err instanceof DepzError)
|
|
113
|
+
return false;
|
|
114
|
+
throw err;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Initialize the sensor: firmware blob download + default config.
|
|
119
|
+
*
|
|
120
|
+
* The blob variant is fixed by the class (`Vl53l8Cx` → 'cx', `Vl53l8Ch` →
|
|
121
|
+
* 'ch'); `variant` is accepted only for backward compatibility and must
|
|
122
|
+
* match the class variant when given. Assets are loaded lazily (dynamic
|
|
123
|
+
* import) so the blobs stay out of bundles that never init the ToF.
|
|
124
|
+
*/
|
|
125
|
+
async init(variant, opts) {
|
|
126
|
+
if (variant !== undefined && variant !== this.variantId) {
|
|
127
|
+
throw new DepzError(`${this.constructor.name} loads the '${this.variantId}' firmware blob; ` +
|
|
128
|
+
"use Vl53l8Ch for 'ch'");
|
|
129
|
+
}
|
|
130
|
+
const assets = await loadAssets(this.variantId);
|
|
131
|
+
this.writeProgressCb = opts?.writeProgress ?? null;
|
|
132
|
+
try {
|
|
133
|
+
const driver = new VL53L8CX(this.platform, assets, this.variantId);
|
|
134
|
+
await driver.init(opts?.progress);
|
|
135
|
+
this.uldDriver = driver;
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
this.writeProgressCb = null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// ── configuration (init() first; not while ranging) ─────────────────────────
|
|
142
|
+
async getResolution() {
|
|
143
|
+
this.resolution = await this.uld.getResolution();
|
|
144
|
+
return this.resolution;
|
|
145
|
+
}
|
|
146
|
+
async setResolution(zones) {
|
|
147
|
+
if (zones !== RESOLUTION_4X4 && zones !== RESOLUTION_8X8) {
|
|
148
|
+
throw new DepzError("resolution is 16 (4x4) or 64 (8x8) zones");
|
|
149
|
+
}
|
|
150
|
+
this.requireNotRanging();
|
|
151
|
+
await this.uld.setResolution(zones);
|
|
152
|
+
this.resolution = zones;
|
|
153
|
+
}
|
|
154
|
+
getRangingFrequencyHz() {
|
|
155
|
+
return this.uld.getRangingFrequencyHz();
|
|
156
|
+
}
|
|
157
|
+
async setRangingFrequencyHz(hz) {
|
|
158
|
+
if (hz < MIN_RANGING_FREQUENCY_HZ) {
|
|
159
|
+
throw new DepzError(`ranging frequency must be >= ${MIN_RANGING_FREQUENCY_HZ} Hz: below that ` +
|
|
160
|
+
"the sensor never enters its ranging loop and streams nothing (contract 04)");
|
|
161
|
+
}
|
|
162
|
+
this.requireNotRanging();
|
|
163
|
+
await this.uld.setRangingFrequencyHz(hz);
|
|
164
|
+
}
|
|
165
|
+
getRangingMode() {
|
|
166
|
+
return this.uld.getRangingMode();
|
|
167
|
+
}
|
|
168
|
+
async setRangingMode(mode) {
|
|
169
|
+
this.requireNotRanging();
|
|
170
|
+
await this.uld.setRangingMode(mode);
|
|
171
|
+
}
|
|
172
|
+
getIntegrationTimeMs() {
|
|
173
|
+
return this.uld.getIntegrationTimeMs();
|
|
174
|
+
}
|
|
175
|
+
async setIntegrationTimeMs(ms) {
|
|
176
|
+
this.requireNotRanging();
|
|
177
|
+
await this.uld.setIntegrationTimeMs(ms);
|
|
178
|
+
}
|
|
179
|
+
getSharpenerPercent() {
|
|
180
|
+
return this.uld.getSharpenerPercent();
|
|
181
|
+
}
|
|
182
|
+
async setSharpenerPercent(pct) {
|
|
183
|
+
this.requireNotRanging();
|
|
184
|
+
await this.uld.setSharpenerPercent(pct);
|
|
185
|
+
}
|
|
186
|
+
getTargetOrder() {
|
|
187
|
+
return this.uld.getTargetOrder();
|
|
188
|
+
}
|
|
189
|
+
async setTargetOrder(order) {
|
|
190
|
+
this.requireNotRanging();
|
|
191
|
+
await this.uld.setTargetOrder(order);
|
|
192
|
+
}
|
|
193
|
+
// ── advanced features (UM3109; init() first, not while ranging) ─────────────
|
|
194
|
+
/** POWER_MODE_SLEEP/WAKEUP/DEEP_SLEEP (uld constants). */
|
|
195
|
+
getPowerMode() {
|
|
196
|
+
return this.uld.getPowerMode();
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Enter sleep / wake / deep-sleep. Not while ranging. Waking from
|
|
200
|
+
* DEEP_SLEEP re-downloads the firmware blob (init()).
|
|
201
|
+
*/
|
|
202
|
+
async setPowerMode(mode) {
|
|
203
|
+
this.requireNotRanging();
|
|
204
|
+
await this.uld.setPowerMode(mode);
|
|
205
|
+
}
|
|
206
|
+
getXtalkMargin() {
|
|
207
|
+
return this.uld.getXtalkMargin();
|
|
208
|
+
}
|
|
209
|
+
async setXtalkMargin(marginKcps) {
|
|
210
|
+
this.requireNotRanging();
|
|
211
|
+
await this.uld.setXtalkMargin(marginKcps);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Run on-device crosstalk calibration against a flat target at
|
|
215
|
+
* `distanceMm` with the given `reflectancePercent` (1..99) averaging
|
|
216
|
+
* `nbSamples` (1..16). The result is captured into the xtalk buffer; read
|
|
217
|
+
* it back with getCaldataXtalk(). Blocks several seconds.
|
|
218
|
+
*/
|
|
219
|
+
async calibrateXtalk(reflectancePercent, nbSamples, distanceMm) {
|
|
220
|
+
this.requireNotRanging();
|
|
221
|
+
await this.uld.calibrateXtalk(reflectancePercent, nbSamples, distanceMm);
|
|
222
|
+
}
|
|
223
|
+
/** Read back the 776-byte xtalk calibration blob (save/restore). */
|
|
224
|
+
async getCaldataXtalk() {
|
|
225
|
+
this.requireNotRanging();
|
|
226
|
+
return this.uld.getCaldataXtalk();
|
|
227
|
+
}
|
|
228
|
+
/** Restore a previously saved 776-byte xtalk calibration blob. */
|
|
229
|
+
async setCaldataXtalk(blob) {
|
|
230
|
+
this.requireNotRanging();
|
|
231
|
+
await this.uld.setCaldataXtalk(blob);
|
|
232
|
+
}
|
|
233
|
+
getDetectionThresholdsEnable() {
|
|
234
|
+
return this.uld.getDetectionThresholdsEnable();
|
|
235
|
+
}
|
|
236
|
+
async setDetectionThresholdsEnable(enabled) {
|
|
237
|
+
this.requireNotRanging();
|
|
238
|
+
await this.uld.setDetectionThresholdsEnable(enabled);
|
|
239
|
+
}
|
|
240
|
+
getDetectionThresholds() {
|
|
241
|
+
return this.uld.getDetectionThresholds();
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Program the 64 detection thresholds (interrupt-on-threshold). Each entry
|
|
245
|
+
* carries lowThresh, highThresh, measurement, type, zoneNum, operation (see
|
|
246
|
+
* uld THRESH_* constants).
|
|
247
|
+
*/
|
|
248
|
+
async setDetectionThresholds(thresholds) {
|
|
249
|
+
this.requireNotRanging();
|
|
250
|
+
await this.uld.setDetectionThresholds(thresholds);
|
|
251
|
+
}
|
|
252
|
+
async setDetectionThresholdsAutoStop(autoStop) {
|
|
253
|
+
this.requireNotRanging();
|
|
254
|
+
await this.uld.setDetectionThresholdsAutoStop(autoStop);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Enable the motion indicator over [distanceMinMm, distanceMaxMm] and
|
|
258
|
+
* surface motion output in each frame's `.motion`. Returns the underlying
|
|
259
|
+
* uld MotionConfig for advanced tuning.
|
|
260
|
+
*/
|
|
261
|
+
async configureMotionIndicator(distanceMinMm = 400, distanceMaxMm = 1500) {
|
|
262
|
+
this.requireNotRanging();
|
|
263
|
+
const resolution = await this.getResolution();
|
|
264
|
+
const cfg = await this.uld.motionIndicatorInit(resolution);
|
|
265
|
+
await this.uld.motionIndicatorSetDistanceMotion(cfg, distanceMinMm, distanceMaxMm);
|
|
266
|
+
return cfg;
|
|
267
|
+
}
|
|
268
|
+
// ── ranging ──────────────────────────────────────────────────────────────────
|
|
269
|
+
/** Configure the output list, start the sensor and the MCU stream. */
|
|
270
|
+
async startRanging() {
|
|
271
|
+
this.requireNotRanging();
|
|
272
|
+
const cnhSize = this.cnhConfig !== null ? this.cnhConfig.requiredMemory() : null;
|
|
273
|
+
await this.getResolution(); // refresh the cache used for frame shaping
|
|
274
|
+
await this.uld.startRanging(cnhSize);
|
|
275
|
+
const frameSize = this.uld.dataReadSize;
|
|
276
|
+
this.reassembler = new FrameReassembler();
|
|
277
|
+
await this.request(Vl53l8Cmd.StartStream, packStartStream(frameSize), {
|
|
278
|
+
okCompletes: true,
|
|
279
|
+
});
|
|
280
|
+
this.rangingFlag = true;
|
|
281
|
+
}
|
|
282
|
+
async stopRanging() {
|
|
283
|
+
if (!this.rangingFlag)
|
|
284
|
+
return;
|
|
285
|
+
await this.request(Vl53l8Cmd.StopStream, undefined, { okCompletes: true });
|
|
286
|
+
this.rangingFlag = false;
|
|
287
|
+
await this.uld.stopRanging();
|
|
288
|
+
}
|
|
289
|
+
get ranging() {
|
|
290
|
+
return this.rangingFlag;
|
|
291
|
+
}
|
|
292
|
+
/** Subscribe to parsed frames (read-pump context; don't block). */
|
|
293
|
+
onFrame(cb) {
|
|
294
|
+
this.frameCbs.push(cb);
|
|
295
|
+
return () => {
|
|
296
|
+
this.frameCbs = this.frameCbs.filter((c) => c !== cb);
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Async iterator over parsed frames — bounded, drop-oldest (contract 07
|
|
301
|
+
* §3). Subscribes eagerly at call time — call before or after
|
|
302
|
+
* startRanging(); it ends when the device closes or the consumer breaks
|
|
303
|
+
* out of iteration.
|
|
304
|
+
*/
|
|
305
|
+
frames(maxsize = 8) {
|
|
306
|
+
const queue = new StreamQueue(maxsize, () => {
|
|
307
|
+
this.frameQueues = this.frameQueues.filter((q) => q !== queue);
|
|
308
|
+
deregister();
|
|
309
|
+
});
|
|
310
|
+
this.frameQueues.push(queue);
|
|
311
|
+
const deregister = this.registerStream(queue);
|
|
312
|
+
return queue;
|
|
313
|
+
}
|
|
314
|
+
/** Convenience: wait for the next frame. */
|
|
315
|
+
async getFrame(timeoutMs = 2000) {
|
|
316
|
+
const queue = new StreamQueue(1);
|
|
317
|
+
this.frameQueues.push(queue);
|
|
318
|
+
// Register for teardown so a disconnect closes the queue promptly (the
|
|
319
|
+
// wait resolves `done` at once) instead of stalling until the timeout.
|
|
320
|
+
const deregister = this.registerStream(queue);
|
|
321
|
+
let timer;
|
|
322
|
+
try {
|
|
323
|
+
const result = await Promise.race([
|
|
324
|
+
queue.next(),
|
|
325
|
+
new Promise((_, reject) => {
|
|
326
|
+
timer = setTimeout(() => reject(new DepzTimeoutError(Vl53l8Rpt.Vl53Frame, timeoutMs)), timeoutMs);
|
|
327
|
+
}),
|
|
328
|
+
]);
|
|
329
|
+
if (result.done === true)
|
|
330
|
+
throw new DepzError("device closed");
|
|
331
|
+
return result.value;
|
|
332
|
+
}
|
|
333
|
+
finally {
|
|
334
|
+
if (timer !== undefined)
|
|
335
|
+
clearTimeout(timer);
|
|
336
|
+
this.frameQueues = this.frameQueues.filter((q) => q !== queue);
|
|
337
|
+
deregister();
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
// ── internal ─────────────────────────────────────────────────────────────────
|
|
341
|
+
requireNotRanging() {
|
|
342
|
+
if (this.rangingFlag) {
|
|
343
|
+
throw new DepzError("stopRanging() first — the stream owns the register bank");
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
handleReport(pkt) {
|
|
347
|
+
if (pkt.cmd !== Vl53l8Rpt.Vl53Frame || pkt.payload.length < 12) {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
const done = this.reassembler.feed(unpackFrameChunk(pkt.payload));
|
|
351
|
+
if (done === null)
|
|
352
|
+
return true;
|
|
353
|
+
if (this.uldDriver === null)
|
|
354
|
+
return true;
|
|
355
|
+
let parsed;
|
|
356
|
+
try {
|
|
357
|
+
parsed = this.uldDriver.parseFrame(done.frame);
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
this.reassembler.discarded += 1;
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
const frame = this.toFrame(done.timestampUs, parsed);
|
|
364
|
+
for (const cb of [...this.frameCbs])
|
|
365
|
+
cb(frame);
|
|
366
|
+
for (const q of [...this.frameQueues])
|
|
367
|
+
q.push(frame);
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
toFrame(timestampUs, parsed) {
|
|
371
|
+
return {
|
|
372
|
+
timestampUs,
|
|
373
|
+
resolution: this.resolution,
|
|
374
|
+
distanceMm: Int32Array.from(parsed.distanceMm),
|
|
375
|
+
targetStatus: Uint8Array.from(parsed.targetStatus),
|
|
376
|
+
nbTargetDetected: Uint8Array.from(parsed.nbTargetDetected),
|
|
377
|
+
signalPerSpad: Float64Array.from(parsed.signalPerSpad),
|
|
378
|
+
ambientPerSpad: Float64Array.from(parsed.ambientPerSpad),
|
|
379
|
+
nbSpadsEnabled: Int32Array.from(parsed.nbSpadsEnabled),
|
|
380
|
+
rangeSigmaMm: Float64Array.from(parsed.rangeSigmaMm),
|
|
381
|
+
reflectance: Uint8Array.from(parsed.reflectance),
|
|
382
|
+
siliconTempDegc: parsed.siliconTempDegc,
|
|
383
|
+
cnhRaw: parsed.cnhRaw,
|
|
384
|
+
motion: parsed.motion,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* VL53L8CH device: the VL53L8CX superset. Inherits every CX method and adds
|
|
390
|
+
* Compact-Network-Histogram (CNH) output. `init()` downloads the CH firmware
|
|
391
|
+
* blob (VL53LMZ ULD 2.0.16). CNH is the reason to run CH firmware: each frame
|
|
392
|
+
* can additionally carry a per-aggregate distance histogram.
|
|
393
|
+
*/
|
|
394
|
+
export class Vl53l8Ch extends Vl53l8Cx {
|
|
395
|
+
variantId = "ch";
|
|
396
|
+
/**
|
|
397
|
+
* Arm the CNH histogram block for the next startRanging(). CH only — this
|
|
398
|
+
* method does not exist on Vl53l8Cx.
|
|
399
|
+
*/
|
|
400
|
+
async configureCnh(config) {
|
|
401
|
+
this.requireNotRanging();
|
|
402
|
+
await this.uld.dciWriteData(MI_CFG_DEV_IDX, config.pack());
|
|
403
|
+
this.cnhConfig = config;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Backward-compatible alias: the old flat `Vl53l8` name maps to the CX base
|
|
408
|
+
* class (the historic default). New code should pick Vl53l8Cx / Vl53l8Ch.
|
|
409
|
+
*/
|
|
410
|
+
export const Vl53l8 = Vl53l8Cx;
|
|
411
|
+
//# sourceMappingURL=vl53l8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vl53l8.js","sourceRoot":"","sources":["../../../src/sensors/vl53l8/vl53l8.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,aAAa,GAEd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,UAAU,EAAsB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAkB,MAAM,UAAU,CAAC;AAC1D,OAAO,EACL,cAAc,EACd,cAAc,EACd,QAAQ,EACR,aAAa,EACb,oBAAoB,GAMrB,MAAM,UAAU,CAAC;AAElB,yDAAyD;AACzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AA6B1C,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,GAAsB,EAAE,UAAkB;IACjE,MAAM,IAAI,GAAG,UAAU,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,IAAI,GAAe,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAa,EAAE,CAAC;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,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YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;YACxD,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;YACtD,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;YACpD,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;YAChD,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;IACJ,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,QAAQ;IACR,SAAS,GAAkB,IAAI,CAAC;IAE5D;;;OAGG;IACH,KAAK,CAAC,YAAY,CAAC,MAAiB;QAClC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;IAC1B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** In-memory transport pair for tests. */
|
|
2
|
+
import type { SerialTransport, SerialTransportInfo } from "./types.js";
|
|
3
|
+
export declare class LoopbackTransport implements SerialTransport {
|
|
4
|
+
readonly info: SerialTransportInfo;
|
|
5
|
+
peer: LoopbackTransport | null;
|
|
6
|
+
private queue;
|
|
7
|
+
private waiter;
|
|
8
|
+
private closed;
|
|
9
|
+
private disconnectCbs;
|
|
10
|
+
static pair(): [LoopbackTransport, LoopbackTransport];
|
|
11
|
+
open(): Promise<void>;
|
|
12
|
+
write(data: Uint8Array): Promise<void>;
|
|
13
|
+
private deliver;
|
|
14
|
+
readable(): AsyncIterableIterator<Uint8Array>;
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
onDisconnect(cb: () => void): () => void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=loopback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopback.d.ts","sourceRoot":"","sources":["../../src/transport/loopback.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEvE,qBAAa,iBAAkB,YAAW,eAAe;IACvD,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAwB;IAC1D,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAEtC,OAAO,CAAC,KAAK,CAAoB;IACjC,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAyB;IAE9C,MAAM,CAAC,IAAI,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ/C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAErB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5C,OAAO,CAAC,OAAO;IAKR,QAAQ,IAAI,qBAAqB,CAAC,UAAU,CAAC;IAW9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAU5B,YAAY,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;CAMzC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** In-memory transport pair for tests. */
|
|
2
|
+
export class LoopbackTransport {
|
|
3
|
+
info = { path: "loopback" };
|
|
4
|
+
peer = null;
|
|
5
|
+
queue = [];
|
|
6
|
+
waiter = null;
|
|
7
|
+
closed = false;
|
|
8
|
+
disconnectCbs = [];
|
|
9
|
+
static pair() {
|
|
10
|
+
const a = new LoopbackTransport();
|
|
11
|
+
const b = new LoopbackTransport();
|
|
12
|
+
a.peer = b;
|
|
13
|
+
b.peer = a;
|
|
14
|
+
return [a, b];
|
|
15
|
+
}
|
|
16
|
+
async open() { }
|
|
17
|
+
async write(data) {
|
|
18
|
+
if (this.closed)
|
|
19
|
+
throw new Error("loopback transport closed");
|
|
20
|
+
this.peer?.deliver(data.slice());
|
|
21
|
+
}
|
|
22
|
+
deliver(data) {
|
|
23
|
+
this.queue.push(data);
|
|
24
|
+
this.waiter?.();
|
|
25
|
+
}
|
|
26
|
+
async *readable() {
|
|
27
|
+
for (;;) {
|
|
28
|
+
while (this.queue.length === 0) {
|
|
29
|
+
if (this.closed)
|
|
30
|
+
return;
|
|
31
|
+
await new Promise((resolve) => (this.waiter = resolve));
|
|
32
|
+
this.waiter = null;
|
|
33
|
+
}
|
|
34
|
+
yield this.queue.shift();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async close() {
|
|
38
|
+
for (const side of [this, this.peer]) {
|
|
39
|
+
if (side && !side.closed) {
|
|
40
|
+
side.closed = true;
|
|
41
|
+
side.waiter?.();
|
|
42
|
+
side.disconnectCbs.forEach((cb) => cb());
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
onDisconnect(cb) {
|
|
47
|
+
this.disconnectCbs.push(cb);
|
|
48
|
+
return () => {
|
|
49
|
+
this.disconnectCbs = this.disconnectCbs.filter((c) => c !== cb);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=loopback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopback.js","sourceRoot":"","sources":["../../src/transport/loopback.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAI1C,MAAM,OAAO,iBAAiB;IACnB,IAAI,GAAwB,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC1D,IAAI,GAA6B,IAAI,CAAC;IAE9B,KAAK,GAAiB,EAAE,CAAC;IACzB,MAAM,GAAwB,IAAI,CAAC;IACnC,MAAM,GAAG,KA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CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBACnB,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBAChB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED,YAAY,CAAC,EAAc;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QAClE,CAAC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js transport over the optional `serialport` peer dependency.
|
|
3
|
+
* Import via `@depz/sensor-sdk/node` only — never from the root export, so
|
|
4
|
+
* browser bundles stay serialport-free.
|
|
5
|
+
*/
|
|
6
|
+
import { type DeviceInfo, type ListOptions, type OpenDeviceOptions, type OpenTarget } from "../discovery.js";
|
|
7
|
+
import type { DepzDevice } from "../device/device.js";
|
|
8
|
+
import type { SerialTransport, SerialTransportInfo } from "./types.js";
|
|
9
|
+
/** Enumerate system serial ports (Node only). */
|
|
10
|
+
export declare function listSerialPorts(): Promise<Array<{
|
|
11
|
+
path: string;
|
|
12
|
+
serialNumber?: string;
|
|
13
|
+
vendorId?: string;
|
|
14
|
+
productId?: string;
|
|
15
|
+
}>>;
|
|
16
|
+
export declare class NodeSerialTransport implements SerialTransport {
|
|
17
|
+
private path;
|
|
18
|
+
readonly info: SerialTransportInfo;
|
|
19
|
+
private port;
|
|
20
|
+
private queue;
|
|
21
|
+
private waiter;
|
|
22
|
+
private ended;
|
|
23
|
+
private disconnectCbs;
|
|
24
|
+
constructor(path: string, serialNumber?: string);
|
|
25
|
+
open(opts?: {
|
|
26
|
+
baudRate?: number;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
private end;
|
|
29
|
+
write(data: Uint8Array): Promise<void>;
|
|
30
|
+
readable(): AsyncIterableIterator<Uint8Array>;
|
|
31
|
+
close(): Promise<void>;
|
|
32
|
+
onDisconnect(cb: () => void): () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Enumerate DEPZ devices on the system's serial ports (Node only).
|
|
36
|
+
*
|
|
37
|
+
* With `matchUsb` (default) only ports carrying a known DEPZ (vid,pid) are
|
|
38
|
+
* probed — fast, and it never pokes unrelated ports. Set `matchUsb: false`
|
|
39
|
+
* for a legacy probe-everything scan.
|
|
40
|
+
*/
|
|
41
|
+
export declare function listDepzDevices(opts?: ListOptions): Promise<DeviceInfo[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Open the right sensor class for `target` over `serialport` (Node only).
|
|
44
|
+
*
|
|
45
|
+
* `target` is a port path (string), a candidate index (number, sorted by USB
|
|
46
|
+
* iSerial), a `DeviceInfo` from `listDepzDevices()`, or omitted for the
|
|
47
|
+
* lowest-serial candidate. Throws `NoDepzDeviceError` when nothing matches —
|
|
48
|
+
* it never grabs an arbitrary system port. See {@link openDeviceFrom}.
|
|
49
|
+
*/
|
|
50
|
+
export declare function openDevice(target?: OpenTarget, opts?: OpenDeviceOptions): Promise<DepzDevice>;
|
|
51
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/transport/node.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,UAAU,EAEf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE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