Advertisement
Guest User

Ten-Minute Guide to rosbridge ver 0.0.1

a guest
Jan 27th, 2012
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement