var isDragging = false;
function connect() {
- ros.connect('ws://wildthumper:9090');
+ ros.connect('ws://'+robothostname+':9090');
}
ros.on('connection', function() {
Y = e.pageY;
}
// relative click position
- var Xrel = X - this.offsetLeft - $(this).width()/2;
- var Yrel = Y - this.offsetTop - $(this).height()/2;
+ var Xrel = X - this.getBoundingClientRect().left - $(this).width()/2;
+ var Yrel = Y - this.getBoundingClientRect().top - $(this).height()/2;
// scale to -1..+1
var trans = -Yrel / ($(this).height()/2);
var rot = -Xrel / ($(this).width()/2);
- setSpeed(trans, rot*3);
+ setSpeed(trans*$("#scale_trans").val(), rot*$("#scale_rot").val());
}
});
// reload
$("img").attr("src", $("img").attr("src"))
});
+
+ $("input[type='number']").spinner();
}
Vue.component('input-value', {