• Diff for "webui"
Differences between revisions 10 and 11
Revision 10 as of 2009-11-11 05:30:18
Size: 2288
Editor: ScottHassan
Comment:
Revision 11 as of 2009-11-12 05:32:06
Size: 2321
Editor: ScottHassan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

== Road Map ==

 * /RoadMap

Installing the WebUI

Road Map

API

ros.js:

  • gPump - the message pump
    • gPump.service_call(service_name, arglist)
      • initiate a service call
    • gPump.publish(topic, topic_type, parameterList)
      • publish a message of type topic_type
  • ros_handleOnLoad(prefix)
    • e.g. ros_handleOnLoad('/ros')

widgets

 <div class="nav_element" objtype=PercentTextWidget topic="/power_state" num="a" div="b"/></div> 

var PercentTextWidget = Class.create({ 
  initialize: function(domobj) { 
    this.pump = null; 
    this.domobj = domobj; 
    this.topics = [domobj.getAttribute("topic")]; 
    this.numerator = domobj.getAttribute("num"); 
    this.denominator = domobj.getAttribute("den"); 
  }, 
 
  init: function() { 
  }, 
 
  receive: function(topic, msg) { 
    if(msg[this.numerator] != null) { 
      var percent = parseFloat(msg[this.numerator]) / parseFloat(msg[this.denominator]); 
      this.domobj.innerHTML = (100. * percent).toFixed(2) + "%"; 
    } 
  } 
}); 
 
gRosClasses["PercentTextWidget"] = function(dom){ 
  return new PercentTextWidget(dom); 
} 

Installing Clearsilver:

apt-get install python-clearsilver

wget http://www.clearsilver.net/downloads/clearsilver-0.10.5.tar.gz
tar xzf clearsilver-0.10.5.tar.gz
cd clearilver-0.10.5
./configure --prefix=/usr --with-python=/usr/bin/python
make
make install

Installing mod_python

wget http://www.gtlib.gatech.edu/pub/apache/httpd/modpython/mod_python-3.3.1.tgz
tar xzf mod_python-3.3.1.tgz
cd mod_python-3.3.1
./configure --prefix=/usr
make
make install

echo 'LoadModule python_module /usr/lib/apache2/modules/mod_python.so' > /etc/apache2/mods-available/mod_python.load
a2enmod mod_python

Installing the Webui

apt-get install apache2 apache2-prefork-dev
rosmake webui
roscd webui
sudo make -f setup.make

sudo mkdir -p /etc/ros/
sudo cp apache.cfg /etc/ros/ros_webui_apache.cfg

Add the following line to /etc/apache2/sites-available/default just above </VirtualHost> near the end of the file:

  Include /etc/ros/ros_webui_apache.cfg

Restart Apache

/etc/init.d/apache2 stop
/etc/init.d/apache2 start

Wiki: webui (last edited 2011-08-09 05:56:14 by HaseruAzuma)