From 6d9f1525855354a6b3a1f15ae5f1ae0b0aa447e3 Mon Sep 17 00:00:00 2001 From: James Hobin Date: Mon, 10 Jun 2024 11:12:41 -0400 Subject: [PATCH] Add language interface to sensor --- tools/spatialSensor/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/spatialSensor/index.js b/tools/spatialSensor/index.js index 956a2c0..d12ccf7 100644 --- a/tools/spatialSensor/index.js +++ b/tools/spatialSensor/index.js @@ -31,6 +31,11 @@ if (!spatialInterface) { spatialInterface = new SpatialInterface(); envelopeContents = new EnvelopeContents(spatialInterface, document.getElementById('container')); spatialInterface.useWebGlWorker(); + + languageInterface = new LanguageInterface('spatialSensor', spatialObject.object, spatialObject.frame); + languageInterface.updateSummarizedState('occupied', false); + languageInterface.updateSummarizedState('position', {x: 0, y: 0, z: 0}); + languageInterface.sendSummarizedStateToParent(); } let threejsInterface = new ThreejsInterface(spatialInterface); @@ -140,6 +145,8 @@ function onHumanPoses(humanPoseObjects) { setSensorActive(active); isPlaybackActive = false; + languageInterface.updateSummarizedState('occupied', active); + languageInterface.sendSummarizedStateToParent(); } function anchoredModelViewCallback(modelViewMatrix, _projectionMatrix) { @@ -193,6 +200,8 @@ function updateSensorPosition() { return; } spatialInterface.analyticsSetSensor(newPos); + languageInterface.updateSummarizedState('position', newPos); + languageInterface.sendSummarizedStateToParent(); oldPos = newPos; }