From 2687f2e4de7a78b8e5a5d2089f648d8ca0c58614 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Thu, 4 Apr 2019 15:45:44 -0400 Subject: [PATCH] Add ros master label. --- backend/js/ros_scripts.js | 19 +++++++++++++++ index.html | 51 ++++++++++++++++++++++++--------------- 2 files changed, 51 insertions(+), 19 deletions(-) diff --git a/backend/js/ros_scripts.js b/backend/js/ros_scripts.js index 59078dc..c41ec39 100644 --- a/backend/js/ros_scripts.js +++ b/backend/js/ros_scripts.js @@ -155,3 +155,22 @@ function toggleRecording() } } } + + +function getMasterName() +{ + var service = new ROSLIB.Service({ + ros : ros, + name : '/rosapi/service_host', + serviceType : 'rosapi/ServiceHost' + }); + + var request = new ROSLIB.ServiceRequest({ + service: '/rosout/get_loggers' // Only the master hosts this service. + }); + + service.callService(request, function(result) { + console.log('Master Name = ' + result.host); + document.getElementById("MasterName").innerHTML = result.host; + }); +} diff --git a/index.html b/index.html index 4324966..d38d517 100644 --- a/index.html +++ b/index.html @@ -64,26 +64,39 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp

Lab UI

-
- +
+
+
+ Master: +
+
+ + +
+
+
+ +