roslibjs and node.js

540 views
Skip to first unread message

Adam Fowler

unread,
Dec 8, 2013, 4:33:44 AM12/8/13
to rosbrid...@googlegroups.com
Hi all,

I was wondering if anyone has thought of extending roslibjs so it could also be used from within a Node.js application, rather than just the browser?

I have a need in a ROS project to communicate with an external database via an existing Node.js driver. I know I can implement a WebSockets rosbridge JSON based client, but it occurs to me that roslibjs has a lot of functionality built in to it that I'd like access to. (Not to mention saving me a bunch of time.)

If possible, I'd like to extend the ROSLIB.Ros call to detect whether it's being used in Node.js or the browser, and implement the underlying comms as appropriate. (From here: http://wiki.ros.org/roslibjs/Tutorials/ActionlibClient )

I've done this before for my own JavaScript library, so am confident I could rejig roslibjs for use within Node.js. I was wondering if anyone had beaten me to it though? No point duplicating effort if it has already been done somewhere.

FYI The database is MarkLogic [1] (who I work for), and the library is MLJS [2] (my own MarkLogic Node.js and browser API layer). 


Thanks in advance,

Adam.

Jihoon

unread,
Dec 8, 2013, 4:42:53 AM12/8/13
to rosbrid...@googlegroups.com
Hello Adam,

You came in the right time!
Somebody has started to discuss about porting roslibjs to work with node.js just a couple of days ago.
Check out this issue in the robot web tools group github.

https://github.com/RobotWebTools/roslibjs/issues/53

Regards,
Jihoon
--
You received this message because you are subscribed to the Google Groups "Rosbridge Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rosbridge-use...@googlegroups.com.
To post to this group, send email to rosbrid...@googlegroups.com.
Visit this group at http://groups.google.com/group/rosbridge-users.
For more options, visit https://groups.google.com/groups/opt_out.

Brandon Alexander

unread,
Dec 8, 2013, 4:43:35 AM12/8/13
to rosbrid...@googlegroups.com, rosbrid...@googlegroups.com
Hi Adam,

Tessa has done some preliminary work with porting roslibjs to Node.js. She outlines some of her thoughts and links to her fork here: https://github.com/RobotWebTools/roslibjs/issues/53. Her and I talked a few days ago and I'm planning to do some investigation on how to better share code between the browser JS implementation and her node.js implementation.  If you have any thoughts, the GitHub issue would be a great place to post them.

Best,
Brandon
--

Adam Fowler

unread,
Dec 8, 2013, 5:52:02 AM12/8/13
to rosbrid...@googlegroups.com
Wow this was good timing!

I've had a look and found I didn't need to change much at all. I've finished my implementation but not tested it yet (Not got ROS set up on my Raspberry Pi yet... I have a feeling that's gonna take some compiling - no binaries available.)

I've checked in changes to my fork, and added info about my approach to the issue you highlighted.

I should get some time in the next couple of weeks to work on this and test it. I'll add the relevant NPM package information and build scripts to my fork too so others can test it out. (I won't publish it to NPM though - I figure you guys will want to do this as part of your build and release process.)

Let me know what you guys think of my approach.

Regards,

Adam.
Reply all
Reply to author
Forward
0 new messages