Added hz counter to viz
@@ -241,7 +241,7 @@ function parseLine(msg) {
}
return {};
}
-
+var oldPoseTime = 0, poseCnt = 0;
$(function() {
setTimeout(function() {
var ws;
@@ -267,8 +267,17 @@ $(function() {
// console.log(obj);
if (obj.type === "pose") {
if (objs[obj.tracker]) {
+ var now = new Date().getTime();
+ if(oldPoseTime + 5000 < now) {
+ oldPoseTime = now;
+ console.log( (poseCnt / 5) + "hz");
+ poseCnt = 0;
+ }
+ poseCnt++;
objs[obj.tracker].position.set(obj.position[0], obj.position[1], obj.position[2]);
objs[obj.tracker].quaternion.set(obj.quat[1], obj.quat[2], obj.quat[3], obj.quat[0]);
+ objs[obj.tracker].verticesNeedUpdate = true;
+ timecode[obj.tracker] = obj.timecode;
}
} else if (obj.type === "info") {
var consoleDiv = $("#console");
