Advancements In Connecting To ROS Via Web With The Rosbridge Suite

During his internship at Willow Garage, Jonathan Mace from Brown University worked on building an industrial strength successor to rosbridge, a popular ROS package for connecting to ROS from a Web browser.  His internship concluded with the release of the rosbridge suite, a robust and extensible collection of packages that facilitate Web-based and non-ROS connection to ROS.

Web browsers are a compelling choice for writing front ends to robot applications.  In particular, they offer a ubiquitous, interoperable platform for robot interaction.  Given that end users of robot applications may require little or no knowledge of the underlying robot middleware, decoupling a Web-based front end from a ROS-dependent back end is a promising direction to pursue.

In order to facilitate this decoupling, the rosbridge suite provides an access point for Web browsers (and other WebSocket-compatible systems) to access ROS.  The rosbridge suite also provides components to automate install and runtime linking of Web components.  As such, the rosbridge suite makes it much easier for ROS developers to include a Web component to their work.

The rosbridge suite primarily contains a Web server which runs inside the ROS environment.  This Web server listens for incoming WebSocket connections, and exchanges JSON-based messages with connected clients.  Clients can instruct rosbridge to call ROS services, subscribe and publish to ROS topics, or introspect the ROS runtime.  Response messages originating in the ROS runtime are propagated back to the client.  Thus, Web browsers and middleware separate from ROS can still fully interact with a running ROS system.

The structure of the JSON messages exchanged between clients and the rosbridge server are defined in the rosbridge protocol.  In order to make the protocol more extensible and pluggable, it was redefined and formally specified.  It is similar in spirit to the protocol used by the original rosbridge, but offers more customization.

Other packages in the rosbridge suite include: roswww, an HTTP Web server that runs in the ROS runtime; rosapi, a node that advertises services that introspect the ROS runtime; and tf smart throttle, a node that intelligently throttles tf messages for low-bandwidth connections.

The rosbridge suite has been released as a ROS stack and is available here.  In addition, tutorials, client implementations, and more information is available at www.rosbridge.org.