rosjs/rosjs — pull request #2 by baalexander (2012-04-12 04:06:12+00:00)
Title: Adds backings to ros.js. Includes initial rosbridge.js.

Two big changes here:

1) ROS is now a class that needs to be instantiated. Example:

```javascript
var ros = new ROS(bridge);
```

This is to support backings (like rosbridge.js or rosnode.js) to talk with the server. It also allows the ros object to emit events, so we can do `ros.on('error', function() { ... })` as discussed.

2) I created an initial version of rosbridge.js. It doesn't do any rosbridge communication, but it hopefully exemplifies how ros.js can interact with a backing.

The basic idea is that ros.js contains the interface (ros.types(), ros.node(), ros.services()) and the backing contains the socket objects (message, topic, service, and param). The developer uses the ros.js interface, while ros.js returns socket objects from whatever the backing implementation is (like rosbridge.js).