Skip to content

Commit

Permalink
Trying to debug issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalacho-mit committed Sep 28, 2024
1 parent 1519c44 commit 4587588
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,14 @@ class Scratch3PoseNetBlocks {
*/
this.firstInstall = true;

this.loadMediaPipeModel();

if (this.runtime.ioDevices) {
this.runtime.on(Runtime.PROJECT_LOADED, this.projectStarted.bind(this));
this.runtime.on(Runtime.PROJECT_RUN_START, this.reset.bind(this));
this._loop();
}

this.loadMediaPipeModel();
}

/**
Expand Down Expand Up @@ -259,12 +260,18 @@ class Scratch3PoseNetBlocks {
if (this.handModel) {
this.handPoseState = this.handModel.detect(frame);
}
else {
console.log("Hand model not loaded");
}
if (this.isConnected()) {
this.runtime.emit(this.runtime.constructor.PERIPHERAL_CONNECTED);
} else {
this.runtime.emit(this.runtime.constructor.PERIPHERAL_DISCONNECTED);
}
}
else {
console.log("No frame");
}
const estimateThrottleTimeout = (+new Date() - time) / 4;
await new Promise(r => setTimeout(r, estimateThrottleTimeout));
}
Expand Down

0 comments on commit 4587588

Please sign in to comment.