Skip to content

Commit

Permalink
Merge pull request #15 from rctoris/stable
Browse files Browse the repository at this point in the history
r2 release
  • Loading branch information
rctoris committed Apr 3, 2013
2 parents 82616d5 + f631940 commit a4f4152
Show file tree
Hide file tree
Showing 90 changed files with 234 additions and 3,369 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
2013-04-03 - **r2**
* Examples now use CDN version of DAE files (rctoris)
* Maps module added with OccupancyGrid and client (rctoris)
* SceneNode now takes an optional pose (rctoris)
* Bugfix in InteractiveMarkerClient path option (rctoris)
* Bugfix in interactive marker feedback (rctoris)

2013-03-17 - **r1**
* Initial development of ROS3D (rctoris)
1 change: 0 additions & 1 deletion README

This file was deleted.

46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
ros3djs
========

#### 3D Visualization Library for use with the ROS JavaScript Libraries ####

For full documentation, see [the ROS wiki](http://ros.org/wiki/ros3djs) or check out some [working demos](http://robotwebtools.org/).

[JSDoc](http://robotwebtools.org/jsdoc/ros3djs/current/) can be found on the Robot Web Tools website.

This project is released as part of the [Robot Web Tools](http://robotwebtools.org/) effort.

### Usage ###
Pre-built files can be found in either [ros3d.js](build/ros3d.js) or [ros3d.min.js](build/ros3d.min.js).

Alternatively, you can use the current release via the Robot Web Tools CDN ([full](http://cdn.robotwebtools.org/ros3djs/current/ros3d.js)) | ([min](http://cdn.robotwebtools.org/ros3djs/current/ros3d.min.js))

### Dependencies ###
ros3djs depends on:

[EventEmitter2](https://github.com/hij1nx/EventEmitter2). The current supported version is 0.4.11.
The current supported version can be found [in this project](include/EventEmitter2/eventemitter2.js) or on the Robot Web Tools CDN ([full](http://cdn.robotwebtools.org/EventEmitter2/0.4.11/eventemitter2.js)) | ([min](http://cdn.robotwebtools.org/EventEmitter2/0.4.11/eventemitter2.min.js))

[three.js](https://github.com/mrdoob/three.js/). The current supported version is r56.
The current supported version can be found [in this project](include/threejs/three.js) or on the Robot Web Tools CDN ([full](http://cdn.robotwebtools.org/threejs/r56/three.js)) | ([min](http://cdn.robotwebtools.org/threejs/r56/three.minjs)).

[roslibjs](https://github.com/RobotWebTools/roslibjs). The current supported version is r4.
The current supported version can be found [in this project](include/roslibjs/roslib.js) or on the Robot Web Tools CDN ([full](http://cdn.robotwebtools.org/roslibjs/r4/roslib.js)) | ([min](http://cdn.robotwebtools.org/roslibjs/r4/roslib.min.js)).

### Build ###
To build from source, use the provided [ANT script](utils/build.xml).

The script requires ANT, YUI Compressor, and JSDoc. To install these on an Ubuntu machine, use the following:

sudo apt-get install ant yui-compressor jsdoc-toolkit

To run the build script, use the following:

cd utils/
ant

### License ###
ros3djs is released with a BSD license. For full terms and conditions, see the [LICENSE](LICENSE) file.

### Authors ###
See the [AUTHORS](AUTHORS) file for a full list of contributors.

26 changes: 17 additions & 9 deletions build/ros3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

var ROS3D = ROS3D || {
REVISION : '1'
REVISION : '2'
};

// Marker types
Expand Down Expand Up @@ -490,7 +490,7 @@ ROS3D.InteractiveMarkerClient = function(options) {
this.ros = options.ros;
this.tfClient = options.tfClient;
this.topic = options.topic;
this.path = '';
this.path = options.path || '/';
this.camera = options.camera;
this.rootObject = options.rootObject || new THREE.Object3D();

Expand Down Expand Up @@ -997,8 +997,8 @@ ROS3D.InteractiveMarkerHandle.prototype.sendFeedback = function(eventType, click
event_type : eventType,
pose : this.pose,
mouse_point : clickPosition,
mousePointValid : mousePointValid,
menuEntryID : menuEntryID
mouse_point_valid : mousePointValid,
menu_entry_id : menuEntryID
};
this.feedbackTopic.publish(feedback);
};
Expand Down Expand Up @@ -1233,7 +1233,7 @@ ROS3D.OccupancyGrid.prototype.__proto__ = THREE.Mesh.prototype;
*/

/**
* A marker client that listens to a given marker topic.
* An occupancy grid client that listens to a given map topic.
*
* Emits the following events:
* * 'change' - there was an update or change in the marker
Expand All @@ -1242,15 +1242,15 @@ ROS3D.OccupancyGrid.prototype.__proto__ = THREE.Mesh.prototype;
* @param options - object with following keys:
* * ros - the ROSLIB.Ros connection handle
* * topic (optional) - the map topic to listen to
* * rootObject (optional) - the root object to add this marker to
* * continuous (optional) - if the map should be continuously loaded (e.g., for SLAM)
* * rootObject (optional) - the root object to add this marker to
*/
ROS3D.OccupancyGridClient = function(options) {
var that = this;
var options = options || {};
var ros = options.ros;
var topic = options.topic || '/map';
this.tfClient = options.tfClient;
this.continuous = options.continuous;
this.rootObject = options.rootObject || new THREE.Object3D();

// current grid that is displayed
Expand All @@ -1264,7 +1264,7 @@ ROS3D.OccupancyGridClient = function(options) {
compression : 'png'
});
rosTopic.subscribe(function(message) {
// check for an old marker
// check for an old map
if (that.currentGrid) {
that.rootObject.remove(that.currentGrid);
}
Expand All @@ -1275,6 +1275,11 @@ ROS3D.OccupancyGridClient = function(options) {
that.rootObject.add(that.currentGrid);

that.emit('change');

// check if we should unsubscribe
if(!that.continuous) {
rosTopic.unsubscribe();
}
});
};
ROS3D.OccupancyGridClient.prototype.__proto__ = EventEmitter2.prototype;
Expand Down Expand Up @@ -1855,6 +1860,7 @@ ROS3D.Urdf = function(options) {
// create a scene node with the model
var sceneNode = new ROS3D.SceneNode({
frameID : frameID,
pose : link.visual.origin,
tfClient : tfClient,
object : new ROS3D.MeshResource({
path : path,
Expand Down Expand Up @@ -1928,6 +1934,7 @@ ROS3D.UrdfClient = function(options) {
* @param options - object with following keys:
* * tfClient - a handle to the TF client
* * frameID - the frame ID this object belongs to
* * pose (optional) - the pose associated with this object
* * object - the THREE 3D object to be rendered
*/
ROS3D.SceneNode = function(options) {
Expand All @@ -1936,6 +1943,7 @@ ROS3D.SceneNode = function(options) {
var tfClient = options.tfClient;
var frameID = options.frameID;
var object = options.object;
this.pose = options.pose || new ROSLIB.Pose();

THREE.Object3D.call(this);
this.useQuaternion = true;
Expand All @@ -1948,7 +1956,7 @@ ROS3D.SceneNode = function(options) {
function(msg) {
// apply the transform
var tf = new ROSLIB.Transform(msg);
var poseTransformed = new ROSLIB.Pose();
var poseTransformed = new ROSLIB.Pose(that.pose);
poseTransformed.applyTransform(tf);

// update the world
Expand Down
2 changes: 1 addition & 1 deletion build/ros3d.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit a4f4152

Please sign in to comment.