From: Erik Andresen Date: Thu, 2 Apr 2020 05:19:58 +0000 (+0200) Subject: Merge branch 'master' of ssh://vontaene/home/erik_alt/git/ros_wild_thumper X-Git-Url: https://defiant.homedns.org/gitweb/?p=ros_wild_thumper.git;a=commitdiff_plain;h=5265263d46b9396252d852a763e68913ad3a913e;hp=-c Merge branch 'master' of ssh://vontaene/home/erik_alt/git/ros_wild_thumper --- 5265263d46b9396252d852a763e68913ad3a913e diff --combined www/assets/javascripts/application.js index 2fc4176,df4c9eb..7a87c12 --- a/www/assets/javascripts/application.js +++ b/www/assets/javascripts/application.js @@@ -4,7 -4,7 +4,7 @@@ function init() var isDragging = false; function connect() { - ros.connect('ws://wildthumper:9090'); + ros.connect('ws://'+robothostname+':9090'); } ros.on('connection', function() { @@@ -189,12 -189,12 +189,12 @@@ 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()); } }); @@@ -238,8 -238,6 +238,8 @@@ // reload $("img").attr("src", $("img").attr("src")) }); + + $("input[type='number']").spinner(); } Vue.component('input-value', { diff --combined www/index.html index 253c35d,bc209ac..db7e48d --- a/www/index.html +++ b/www/index.html @@@ -21,6 -21,9 +21,9 @@@ + Wild Thumper control @@@ -112,18 -115,10 +115,18 @@@
-
+
+
+
+
+
+ + +
+
- +