Skip to content

Commit

Permalink
preparation for node module npm release
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoonl committed Nov 7, 2014
1 parent c76efb0 commit f0f6855
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test
examples
Gruntfile.js
.gitignore
.travis.yml
bower.json
*.md
45 changes: 45 additions & 0 deletions examples/node_simple.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env node

// Connecting to ROS
var ROSLIB = require('roslib');

var ros = new ROSLIB.Ros({
url : 'ws://localhost:9090'
});

ros.on('connection', function() {
console.log('Connected to websocket server.');
});

ros.on('error', function(error) {
console.log('Error connecting to websocket server: ', error);
});

ros.on('close', function() {
console.log('Connection to websocket server closed.');
});

// Publishing a Topic
// ------------------

var cmdVel = new ROSLIB.Topic({
ros : ros,
name : '/cmd_vel',
messageType : 'geometry_msgs/Twist'
});

var twist = new ROSLIB.Message({
linear : {
x : 0.1,
y : 0.2,
z : 0.3
},
angular : {
x : -0.1,
y : -0.2,
z : -0.3
}
});

console.log("Publishing cmd_vel");
cmdVel.publish(twist);
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "roslibjs",
"name": "roslib",
"main": "./src/RosLibNode.js",
"browserify": "./src/RosLibBrowser.js",
"devDependencies": {
Expand Down Expand Up @@ -31,12 +31,17 @@
"ws": "./src/util/shim/WebSocket.js",
"./src/util/DOMParser.js": "./src/util/shim/DOMParser.js"
},
"description": "roslibjs",
"homepage": "https://www.robotwebtools.org",
"description": "The standard ROS Javascript Library",
"version": "0.9.0",
"license": "BSD",
"directories": {
"example": "examples",
"test": "test"
},
"engines": {
"node": ">=0.10"
},
"scripts": {
"test": "grunt test",
"test-examples": "grunt mochaTest:examples && karma start test/examples/karma.conf.js",
Expand All @@ -48,14 +53,15 @@
"type": "git",
"url": "https://github.com/RobotWebTools/roslibjs/releases"
},
"bugs": {
"url": "https://github.com/RobotWebTools/roslibjs/issues"
},
"keywords": [
"ROS"
"ROS",
"ros",
"roslib",
"roslibjs",
"robot"
],
"authors": [
"Russell Toris ([email protected])",
"Jihoon Lee ([email protected])",
"Brandon Alexander ([email protected])",
"David Gossow ([email protected])",
"Benjamin Pitzer ([email protected])"
]
"author": "Robot Webtools Team <[email protected]> (http://robotwebtools.org)"
}

0 comments on commit f0f6855

Please sign in to comment.