]> defiant.homedns.org Git - ros_wild_thumper.git/blobdiff - www/assets/javascripts/application.js
Added full_coverage_path_planner launch file
[ros_wild_thumper.git] / www / assets / javascripts / application.js
index df4c9ebfefc7ca40845878a06c68b83a65dfa34b..02dfe59f101db11bf15bd00b1eedec34a51bdf95 100644 (file)
@@ -17,9 +17,9 @@ function init() {
 
        ros.on('close', function() {
                information.alerts.push({message: "Connection to websocket server closed.", info: true});
-               setTimeout(function() {
-                       connect();
-               }, 2000);
+               //setTimeout(function() {
+               //      connect();
+               //}, 2000);
        });
 
        //tfClient.subscribe('base_link', function(tf) {
@@ -189,12 +189,12 @@ function init() {
                                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,6 +238,9 @@ function init() {
                // reload
                $("img").attr("src", $("img").attr("src"))
        });
+
+       $("input[type='number']").spinner();
+       $("#usb_cam").attr("src", "http://"+robothostname+":8080/stream?topic=/camera/color/image_raw");
 }
 
 Vue.component('input-value', {