-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preparation for node module npm release
- Loading branch information
Showing
3 changed files
with
68 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test | ||
examples | ||
Gruntfile.js | ||
.gitignore | ||
.travis.yml | ||
bower.json | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": { | ||
|
@@ -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", | ||
|
@@ -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)" | ||
} |