From edf9052c22927662ef6d4c7dd7678bd65f65a212 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Ubeira Date: Thu, 17 Jan 2019 16:20:06 -0300 Subject: [PATCH] Getting global config from ROS parameter when connecting to ROS. (#15) --- ros-rviz.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ros-rviz.html b/ros-rviz.html index 1f0b358..799dd51 100644 --- a/ros-rviz.html +++ b/ros-rviz.html @@ -441,6 +441,7 @@ }, _rosChanged: function() { + var that = this; this._tfClient = new ROSLIB.TFClient({ ros: this.ros, angularThres: 0.01, @@ -448,6 +449,22 @@ transThres: 0.01, rate: 10.0 }); + + this._configParam = new ROSLIB.Param({ + ros: this.ros, + name: '/rvizweb/global_config' + }); + + this._configParam.get(function(value) { + if (value != null) { + try { + that.$.configText.value = value; + that._applyConfigText(); + } catch (ex) { + console.log('Could not load configuration: ', value); + } + } + }); }, _toggleDisplayList: function() {