-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full nodejs support #104
Full nodejs support #104
Conversation
I'm going to break this out into multiple commits actually and squash them down later so it's easier to process |
c6c5e06
to
7fd5113
Compare
Can https://github.com/megawac/roslibjs/blob/umd-modules/CONTRIBUTING.md contain at the least the original Ubuntu specific versions of the install instructions? It used to be a quick 1-2-3 copy paste for Ubuntu devs and now its just a bunch of links. |
Sure thing. Should I just add points like
$ sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++ |
Yeah, there was a weird setup point for the doc building too that is nice to have. Installing Node on Ubunutu is also non-trivial to first timers so this whole guide was pretty useful: https://github.com/RobotWebTools/roslibjs/blob/develop/utils/README.md |
Hows this look @rctoris https://gist.github.com/megawac/15637865f848253c6a83 |
# Install this projects Deps
sudo npm install Non-sudo, here yes? |
Building node-canvas (for image decoding) requires install to be called with sudo. I've been debating making it an optionalDependency for that reason It also appears some older versions of node-canvas don't require it |
Another option is to write a Install.sh script that supports Ubuntu/OS X On Fri, Sep 12, 2014 at 1:14 PM, Russell Toris notifications@github.com
|
Another cool thing we can do with this perhaps is mix a bunch of these modules into the var ROSLIB = require("./");
var ros = new ROSLIB.Ros({
url : 'ws://localhost:9090'
});
var turtles = ros.Topic({
name: '/turtle1/pose'
});
// Instead of
var ROSLIB = require("./");
var ros = new ROSLIB.Ros({
url : 'ws://localhost:9090'
});
var turtles = new ROSLIB.Topic({
ros: ros,
name: '/turtle1/pose'
}); smt like ['ActionClient', 'SimpleActionServer', 'Param', 'Service', 'Topic', 'TFClient'].forEach(function(className) {
var Class = ROSLIB[className];
Ros.prototype[className] = function(options) {
options.ros = this;
return new Class(options);
};
}); |
I think that introduces a pretty major API change though. |
Side note: |
Nope. BTW - I was suggesting that for post patch - and if that is implemented it would be backwards compatible. |
0c1d82f
to
f6ca4e2
Compare
f6ca4e2
to
2b3adc9
Compare
Rebased --- Have been running the examples/integration_tests I've tested so far without issue. Is there anything I've been playing around a bit further and have been using this like below: var Ros = require("roslibjs/src/core/Ros");
var ros = new Ros(/*connect to rosbridge*/);
var navsat = ros.Topic({
name: '/navsat/fix',
messageType: 'sensor_msgs/NavSatFix'
}); Areas for further exploration include connecting to bridge via a TCP socket instead of a websocket (w/o impacting the clientside code), topic -> stream, some refactoring |
Roslib TF example Node version -- nearly identical... var Ros = require('../src/core/Ros');
var TFClient = require('../src/tf/TFClient');
var ros = new Ros();
ros.on('error', function(error) {
console.log(error);
});
ros.on('connection', function() {
console.log('Connection made!');
});
ros.on('close', function() {
console.log('Connection closed.');
});
ros.connect('ws://localhost:9090');
var tfClient = new TFClient({
ros : ros,
fixedFrame : 'world',
angularThres : 0.01,
transThres : 0.01
});
tfClient.subscribe('turtle1', function(tf) {
console.log(tf);
}); |
e49d840
to
b589698
Compare
b589698
to
3b27edf
Compare
Alright at this point, I'm happy with the state of things -- few others points I feel out of scope for this pr (e.g. supporting TCP connections). @rctoris any other comments? |
Sorry for the delay in response! Have been on the road the past few days with limited internet access along the way. Will get back to this and the other open requests within the next day or so!! |
Looks great to me! Awesome work here!!! I hated having the separate branches this is perfect. |
👍 |
Looks sweet! I would like to re-release the new version in npm too. Is there any suggested way? |
Once I release, I will remove nodejs branch. |
Are you planning to change the package name from roslib to roslibjs? |
Turns out you don't need to |
- this is necessary to make sure all native dependencies (such as cairo) can be installed locally. As a meteor package on atmosphere we would have to publish binary builts which I don't yet know how to do given those third-party dependencies. The way it is now you just need to make sure all those dependencies are already installed on your machine (RobotWebTools/roslibjs#104): On Ubuntu: $ sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++ on osx this might work (assuming you have xcode with command line tools installed): brew install cairo libjpeg libgif
Requires review and if accepted will null the need of the
nodejs
branch. There is a ton of small build refactorings in here so this diff is going to be difficult to process -- I recommend viewing the actual branch: https://github.com/megawac/roslibjs/tree/umd-modulesI'm still in the process of running the examples and integration....
Fixes #53
Additional install steps:
cario
. System specific guide: https://github.com/Automattic/node-canvas/wiki/_pages