@blueharford/scrypted-spatial-awareness 0.6.21 → 0.6.23
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/dist/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +11 -7
- package/out/main.nodejs.js.map +1 -1
- package/out/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/core/topology-discovery.ts +8 -4
- package/src/main.ts +3 -0
- package/src/ui/editor-html.ts +2 -2
package/out/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -748,16 +748,20 @@ Use the mount height to help estimate distances - objects at ground level will a
|
|
|
748
748
|
return null;
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
//
|
|
751
|
+
// ALWAYS generate suggestions from each camera's analysis first
|
|
752
|
+
// This ensures landmarks and zones from individual cameras are captured
|
|
753
|
+
for (const analysis of analyses) {
|
|
754
|
+
this.generateSuggestionsFromAnalysis(analysis);
|
|
755
|
+
}
|
|
756
|
+
this.console.log(`[Discovery] Generated suggestions from ${analyses.length} camera analyses`);
|
|
757
|
+
|
|
758
|
+
// Then correlate if we have multiple cameras (adds shared landmarks and connections)
|
|
752
759
|
let correlation: TopologyCorrelation | null = null;
|
|
753
760
|
if (analyses.length >= 2) {
|
|
754
761
|
correlation = await this.correlateScenes(analyses);
|
|
755
762
|
if (correlation) {
|
|
756
763
|
this.generateSuggestionsFromCorrelation(correlation);
|
|
757
764
|
}
|
|
758
|
-
} else if (analyses.length === 1) {
|
|
759
|
-
// Single camera - generate suggestions from its analysis
|
|
760
|
-
this.generateSuggestionsFromAnalysis(analyses[0]);
|
|
761
765
|
}
|
|
762
766
|
|
|
763
767
|
this.status.lastScanTime = Date.now();
|
package/src/main.ts
CHANGED
|
@@ -1919,6 +1919,9 @@ export class SpatialAwarenessPlugin extends ScryptedDeviceBase
|
|
|
1919
1919
|
const distanceFeet = landmarkData.distanceFeet || 50; // Default 50ft if not set
|
|
1920
1920
|
const distanceInPixels = distanceFeet * floorPlanScale;
|
|
1921
1921
|
|
|
1922
|
+
// Debug: log the distance data to verify it's being used correctly
|
|
1923
|
+
this.console.log(`[Discovery] Landmark "${suggestion.landmark.name}" distance data: distanceFeet=${distanceFeet}, distance="${landmarkData.distance || 'not set'}", floorPlanScale=${floorPlanScale}, distanceInPixels=${distanceInPixels}`);
|
|
1924
|
+
|
|
1922
1925
|
// Use bounding box for horizontal positioning within the FOV
|
|
1923
1926
|
const bbox = landmarkData.boundingBox as [number, number, number, number] | undefined;
|
|
1924
1927
|
|
package/src/ui/editor-html.ts
CHANGED
|
@@ -343,7 +343,7 @@ export const EDITOR_HTML = `<!DOCTYPE html>
|
|
|
343
343
|
<div class="modal-overlay" id="add-zone-modal">
|
|
344
344
|
<div class="modal">
|
|
345
345
|
<h2>Create Zone</h2>
|
|
346
|
-
<p style="color: #888; margin-bottom: 15px; font-size: 13px;">Click points on the canvas to draw a polygon.
|
|
346
|
+
<p style="color: #888; margin-bottom: 15px; font-size: 13px;">Click points on the canvas to draw a polygon. Click "Finish Zone" button or press Enter to complete.</p>
|
|
347
347
|
<div class="form-group">
|
|
348
348
|
<label>Zone Name</label>
|
|
349
349
|
<input type="text" id="zone-name-input" placeholder="e.g., Front Yard">
|
|
@@ -1110,7 +1110,7 @@ export const EDITOR_HTML = `<!DOCTYPE html>
|
|
|
1110
1110
|
ctx.fillStyle = '#fff';
|
|
1111
1111
|
ctx.font = 'bold 12px sans-serif';
|
|
1112
1112
|
ctx.textAlign = 'left';
|
|
1113
|
-
ctx.fillText('Click to add points.
|
|
1113
|
+
ctx.fillText('Click to add points. Click "Finish Zone" button or press Enter to complete. Esc to cancel.', 10, canvas.height - 10);
|
|
1114
1114
|
}
|
|
1115
1115
|
|
|
1116
1116
|
// Draw landmarks first (below cameras and connections)
|