Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Ten-Minute Guide to rosbridge ver 0.0.1

By: a guest on Jan 27th, 2012  |  syntax: None  |  size: 1.42 KB  |  views: 334  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Ten-Minute Guide to rosbridge
  2.  
  3. More information is available from:
  4. http://ros.org/wiki/rosbridge (the documentation page for rosbridge on ros.org)
  5. http://ros.org/wiki/rosjs (the ros.js documentation page)
  6. and by writing tjay@cs.brown.edu
  7.  
  8. After installing ROS ( http://www.ros.org/wiki/ROS/Installation ), rosbridge is available either:
  9.  
  10. 1) By apt-get repository (after installing the ROS apt sources) via:
  11. sudo apt-get install ros-electric-brown-remotelab
  12.  
  13. or
  14.  
  15. 2) Via SVN checkout:
  16. svn co https://brown-ros-pkg.googlecode.com/svn/trunk/experimental/rosbridge rosbridge
  17.  
  18. to launch rosbridge:
  19. rosrun rosbridge rosbridge.py
  20.  
  21. by default rosbridge runs on port 9090 .
  22.  
  23. To talk to rosbridge, use JSON ( http://www.json.org/ ) messages wrapped in byte 0 and byte 255 (you may optionally include a newline before the 255. Communication from the server will come similarly wrapped, and with a newline before the 255. rosbridge only supports pure ASCII messages.
  24.  
  25. To publish:
  26. {"receiver":"/topic","msg":{"fieldname":"value"},"type":"ros/type"}
  27.  
  28. To make a service call:
  29. {"receiver":"/service","msg":["in","order","arguments"]}
  30.  
  31. Most of the functionality of the ROS C++ and Python API is available as pseudo-services provided by rosbridge. See the ros.js tutorial for more information.
  32.  
  33. Example:
  34. {"receiver":"/rosbridge/subscribe","msg":["/topic",-1,"type"]}
  35.  
  36. subscribes to the /topic regardless of whether it currently exists.