From cf71b520bc548b9e71a695eb16dc8b6b1cf159b4 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Mon, 15 Apr 2013 09:06:45 -0700 Subject: [PATCH 1/7] minor cleanup --- .gitignore | 3 +-- AUTHORS.md | 1 + CHANGELOG.md | 1 + README.md | 14 +++++--------- utils/Gruntfile.js | 8 ++++---- utils/README.md | 17 ++++++----------- 6 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 25d2f4ba..a3083179 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .project .settings -.svn -node_modules .vagrant +node_modules diff --git a/AUTHORS.md b/AUTHORS.md index 97c9eb56..d73a3fd9 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -14,3 +14,4 @@ Contributors * Xueqiao Xu (xueqiaoxu@gmail.com) * Mr.doob - (http://mrdoob.com) * AlteredQualia - (http://alteredqualia.com) + diff --git a/CHANGELOG.md b/CHANGELOG.md index c24e3615..2880b2ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,3 +23,4 @@ DEVEL - **r4** 2013-03-17 - **r1** * Initial development of ROS3D [(rctoris)](https://github.com/rctoris/) + diff --git a/README.md b/README.md index 32d74e9c..6a0b7ad5 100644 --- a/README.md +++ b/README.md @@ -11,22 +11,18 @@ This project is released as part of the [Robot Web Tools](http://robotwebtools.o ### 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)) +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)) +[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.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.min.js)) -[ColladaLoader2](https://github.com/crobi/ColladaAnimationCompress). The current supported version is 0.0.1. -The current supported version can be found [in this project](include/ColladaAnimationCompress/ColladaLoader2.js) or on the Robot Web Tools CDN ([full](http://cdn.robotwebtools.org/ColladaAnimationCompress/0.0.1/ColladaLoader2.js)) | ([min](http://cdn.robotwebtools.org/ColladaAnimationCompress/0.0.1/ColladaLoader2.min.js)). +[ColladaLoader2](https://github.com/crobi/ColladaAnimationCompress). The current supported version is 0.0.1. The current supported version can be found [in this project](include/ColladaAnimationCompress/ColladaLoader2.js) or on the Robot Web Tools CDN: ([full](http://cdn.robotwebtools.org/ColladaAnimationCompress/0.0.1/ColladaLoader2.js)) | ([min](http://cdn.robotwebtools.org/ColladaAnimationCompress/0.0.1/ColladaLoader2.min.js)) -[roslibjs](https://github.com/RobotWebTools/roslibjs). The current supported version is r5. -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/r5/roslib.min.js)). +[roslibjs](https://github.com/RobotWebTools/roslibjs). The current supported version is r5. 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/r5/roslib.min.js)) ### Build Checkout [utils/README.md](utils/README.md) for details on building. diff --git a/utils/Gruntfile.js b/utils/Gruntfile.js index 2bac6b39..42832ca6 100644 --- a/utils/Gruntfile.js +++ b/utils/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { pkg: grunt.file.readJSON('package.json'), concat: { build: { - src : ['../src/Ros3D.js', '../src/**/*.js'], + src : ['../src/*.js', '../src/**/*.js'], dest : '../build/ros3d.js' } }, @@ -39,7 +39,7 @@ module.exports = function(grunt) { interrupt: true }, files: [ - '../src/Ros3D.js', + '../src/*.js', '../src/**/*.js' ], tasks: ['concat'] @@ -51,7 +51,7 @@ module.exports = function(grunt) { files: [ 'Gruntfile.js', '.jshintrc', - '../src/Ros3D.js', + '../src/*.js', '../src/**/*.js' ], tasks: ['build'] @@ -66,7 +66,7 @@ module.exports = function(grunt) { jsdoc: { doc: { src: [ - '../src/Ros3D.js', + '../src/*.js', '../src/**/*.js' ], options: { diff --git a/utils/README.md b/utils/README.md index 51ff5bfe..b1ab03a0 100644 --- a/utils/README.md +++ b/utils/README.md @@ -1,8 +1,7 @@ ros3djs Build Setup -==================== +=================== -[Grunt](http://gruntjs.com/) is used for building, including concatenating, -minimizing, documenting, linting, and testing. +[Grunt](http://gruntjs.com/) is used for building, including concatenating, minimizing, documenting, linting, and testing. ### Install Grunt and its Dependencies @@ -42,13 +41,9 @@ To run the build tasks: 1. `cd /path/to/ros3djs/utils/` 2. `grunt build` -`grunt build` will concatenate and minimize the files under src and replace -ros3d.js and ros3d.min.js in the build directory. It will also run the linter -and test cases. This is what [Travis -CI](https://travis-ci.org/RobotWebTools/ros3djs) runs when a Pull Request is -submitted. +`grunt build` will concatenate and minimize the files under src and replace ros3d.js and ros3d.min.js in the build directory. It will also run the linter and test cases. This is what [Travis CI](https://travis-ci.org/RobotWebTools/ros3djs) runs when a Pull Request is submitted. -`grunt dev` will watch for any changes to any of the src/ files and -automatically concatenate and minimize the files. This is ideal for those -developing as you should only have to run `grunt dev` once. +`grunt dev` will watch for any changes to any of the src/ files and automatically concatenate and minimize the files. This is ideal for those developing as you should only have to run `grunt dev` once. + +`grunt doc` will rebuild all JSDoc for the project. From 4dd073dd4efd59d5fc26ddaac2617c38c6906b94 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Mon, 15 Apr 2013 09:10:38 -0700 Subject: [PATCH 2/7] r4 release build --- build/ros3d.js | 2 +- build/ros3d.min.js | 2 +- src/Ros3D.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/ros3d.js b/build/ros3d.js index 6ddf736c..6401affc 100644 --- a/build/ros3d.js +++ b/build/ros3d.js @@ -4,7 +4,7 @@ */ var ROS3D = ROS3D || { - REVISION : '4-devel' + REVISION : '4' }; // Marker types diff --git a/build/ros3d.min.js b/build/ros3d.min.js index e7a9fc49..6c8c8ed8 100644 --- a/build/ros3d.min.js +++ b/build/ros3d.min.js @@ -1,2 +1,2 @@ -var ROS3D=ROS3D||{REVISION:"4-devel"};ROS3D.MARKER_ARROW=0,ROS3D.MARKER_CUBE=1,ROS3D.MARKER_SPHERE=2,ROS3D.MARKER_CYLINDER=3,ROS3D.MARKER_LINE_STRIP=4,ROS3D.MARKER_LINE_LIST=5,ROS3D.MARKER_CUBE_LIST=6,ROS3D.MARKER_SPHERE_LIST=7,ROS3D.MARKER_POINTS=8,ROS3D.MARKER_TEXT_VIEW_FACING=9,ROS3D.MARKER_MESH_RESOURCE=10,ROS3D.MARKER_TRIANGLE_LIST=11,ROS3D.INTERACTIVE_MARKER_KEEP_ALIVE=0,ROS3D.INTERACTIVE_MARKER_POSE_UPDATE=1,ROS3D.INTERACTIVE_MARKER_MENU_SELECT=2,ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK=3,ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN=4,ROS3D.INTERACTIVE_MARKER_MOUSE_UP=5,ROS3D.INTERACTIVE_MARKER_NONE=0,ROS3D.INTERACTIVE_MARKER_MENU=1,ROS3D.INTERACTIVE_MARKER_BUTTON=2,ROS3D.INTERACTIVE_MARKER_MOVE_AXIS=3,ROS3D.INTERACTIVE_MARKER_MOVE_PLANE=4,ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS=5,ROS3D.INTERACTIVE_MARKER_MOVE_ROTATE=6,ROS3D.INTERACTIVE_MARKER_INHERIT=0,ROS3D.INTERACTIVE_MARKER_FIXED=1,ROS3D.INTERACTIVE_MARKER_VIEW_FACING=2,ROS3D.makeColorMaterial=function(e,t,r,i){var o=new THREE.Color;return o.setRGB(e,t,r),.99>=i?new THREE.MeshBasicMaterial({color:o.getHex(),opacity:i+.1,transparent:!0,depthWrite:!0,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneMinusSrcAlphaFactor,blendEquation:THREE.ReverseSubtractEquation,blending:THREE.NormalBlending}):new THREE.MeshLambertMaterial({color:o.getHex(),opacity:i,blending:THREE.NormalBlending})},ROS3D.intersectPlane=function(e,t,r){var i=new THREE.Vector3,o=new THREE.Vector3;i.subVectors(t,e.origin);var n=e.direction.dot(r);if(Math.abs(n)=Math.abs(h))return void 0;var d=n*a-s*c,p=d/h;return p},ROS3D.closestAxisPoint=function(e,t,r){var i=new THREE.Projector,o=e.origin.clone();i.projectVector(o,t);var n=e.direction.clone().add(e.origin);i.projectVector(n,t);var a=n.clone().sub(o),s=new THREE.Vector2,c=s.subVectors(r,o).dot(a)/a.dot(a),l=new THREE.Vector2;l.addVectors(o,a.clone().multiplyScalar(c));var h=new THREE.Vector3(l.x,l.y,.5);i.unprojectVector(h,t);var d=new THREE.Ray(t.position,h.sub(t.position).normalize());return ROS3D.findClosestPoint(e,d)},ROS3D.InteractiveMarker=function(e){THREE.Object3D.call(this),THREE.EventDispatcher.call(this);var t=this;e=e||{};var r=e.handle;this.name=r.name;var i=e.camera,o=e.path||"/";this.dragging=!1,this.onServerSetPose({pose:r.pose}),this.dragStart={position:new THREE.Vector3,orientation:new THREE.Quaternion,positionWorld:new THREE.Vector3,orientationWorld:new THREE.Quaternion,event3d:{}},r.controls.forEach(function(e){t.add(new ROS3D.InteractiveMarkerControl({parent:t,message:e,camera:i,path:o}))}),r.menuEntries.length>0&&(this.menu=new ROS3D.InteractiveMarkerMenu({menuEntries:r.menuEntries}),this.menu.addEventListener("menu-select",function(e){t.dispatchEvent(e)}))},ROS3D.InteractiveMarker.prototype.__proto__=THREE.Object3D.prototype,ROS3D.InteractiveMarker.prototype.showMenu=function(e,t){this.menu&&this.menu.show(e,t)},ROS3D.InteractiveMarker.prototype.moveAxis=function(e,t,r){if(this.dragging){var i=e.currentControlOri,o=t.clone().applyQuaternion(i),n=this.dragStart.event3d.intersection.point,a=o.clone().applyQuaternion(this.dragStart.orientationWorld.clone()),s=new THREE.Ray(n,a),c=ROS3D.closestAxisPoint(s,r.camera,r.mousePos),l=new THREE.Vector3;l.addVectors(this.dragStart.position,o.clone().applyQuaternion(this.dragStart.orientation).multiplyScalar(c)),this.setPosition(e,l),r.stopPropagation()}},ROS3D.InteractiveMarker.prototype.movePlane=function(e,t,r){if(this.dragging){var i=e.currentControlOri,o=t.clone().applyQuaternion(i),n=this.dragStart.event3d.intersection.point,a=o.clone().applyQuaternion(this.dragStart.orientationWorld),s=ROS3D.intersectPlane(r.mouseRay,n,a),c=new THREE.Vector3;c.subVectors(s,n),c.add(this.dragStart.positionWorld),this.setPosition(e,c),r.stopPropagation()}},ROS3D.InteractiveMarker.prototype.rotateAxis=function(e,t,r){if(this.dragging){e.updateMatrixWorld();var i=e.currentControlOri,o=i.clone().multiply(t.clone()),n=new THREE.Vector3(1,0,0).applyQuaternion(o),a=this.dragStart.event3d.intersection.point,s=n.applyQuaternion(this.dragStart.orientationWorld),c=ROS3D.intersectPlane(r.mouseRay,a,s),l=new THREE.Ray(this.dragStart.positionWorld,s),h=ROS3D.intersectPlane(l,a,s),d=this.dragStart.orientationWorld.clone().multiply(o),p=d.clone().inverse();c.sub(h),c.applyQuaternion(p);var u=this.dragStart.event3d.intersection.point.clone();u.sub(h),u.applyQuaternion(p);var E=Math.atan2(c.y,c.z),R=Math.atan2(u.y,u.z),m=R-E,v=new THREE.Quaternion;v.setFromAxisAngle(n,m),this.setOrientation(e,v.multiply(this.dragStart.orientationWorld)),r.stopPropagation()}},ROS3D.InteractiveMarker.prototype.feedbackEvent=function(e,t){this.dispatchEvent({type:e,position:this.position.clone(),orientation:this.quaternion.clone(),controlName:t.name})},ROS3D.InteractiveMarker.prototype.startDrag=function(e,t){if(0===t.domEvent.button){t.stopPropagation(),this.dragging=!0,this.updateMatrixWorld(!0);var r=new THREE.Vector3;this.matrixWorld.decompose(this.dragStart.positionWorld,this.dragStart.orientationWorld,r),this.dragStart.position=this.position.clone(),this.dragStart.orientation=this.quaternion.clone(),this.dragStart.event3d=t,this.feedbackEvent("user-mousedown",e)}},ROS3D.InteractiveMarker.prototype.stopDrag=function(e,t){0===t.domEvent.button&&(t.stopPropagation(),this.dragging=!1,this.dragStart.event3d={},this.onServerSetPose(this.bufferedPoseEvent),this.bufferedPoseEvent=void 0,this.feedbackEvent("user-mouseup",e))},ROS3D.InteractiveMarker.prototype.buttonClick=function(e,t){t.stopPropagation(),this.feedbackEvent("user-button-click",e)},ROS3D.InteractiveMarker.prototype.setPosition=function(e,t){this.position=t,this.feedbackEvent("user-pose-change",e)},ROS3D.InteractiveMarker.prototype.setOrientation=function(e,t){t.normalize(),this.quaternion=t,this.feedbackEvent("user-pose-change",e)},ROS3D.InteractiveMarker.prototype.onServerSetPose=function(e){if(void 0!==e)if(this.dragging)this.bufferedPoseEvent=e;else{var t=e.pose;this.position.x=t.position.x,this.position.y=t.position.y,this.position.z=t.position.z,this.useQuaternion=!0,this.quaternion=new THREE.Quaternion(t.orientation.x,t.orientation.y,t.orientation.z,t.orientation.w),this.updateMatrixWorld(!0)}},ROS3D.InteractiveMarkerClient=function(e){e=e||{},this.ros=e.ros,this.tfClient=e.tfClient,this.topic=e.topic,this.path=e.path||"/",this.camera=e.camera,this.rootObject=e.rootObject||new THREE.Object3D,this.interactiveMarkers={},this.updateTopic=null,this.feedbackTopic=null,this.topic&&this.subscribe(this.topic)},ROS3D.InteractiveMarkerClient.prototype.subscribe=function(e){this.unsubscribe(),this.updateTopic=new ROSLIB.Topic({ros:this.ros,name:e+"/tunneled/update",messageType:"visualization_msgs/InteractiveMarkerUpdate",compression:"png"}),this.updateTopic.subscribe(this.processUpdate.bind(this)),this.feedbackTopic=new ROSLIB.Topic({ros:this.ros,name:e+"/feedback",messageType:"visualization_msgs/InteractiveMarkerFeedback",compression:"png"}),this.feedbackTopic.advertise(),this.initService=new ROSLIB.Service({ros:this.ros,name:e+"/tunneled/get_init",serviceType:"demo_interactive_markers/GetInit"});var t=new ROSLIB.ServiceRequest({});this.initService.callService(t,this.processInit.bind(this))},ROS3D.InteractiveMarkerClient.prototype.unsubscribe=function(){this.updateTopic&&this.updateTopic.unsubscribe(),this.feedbackTopic&&this.feedbackTopic.unadvertise();for(var e in this.interactiveMarkers)this.eraseIntMarker(e);this.interactiveMarkers={}},ROS3D.InteractiveMarkerClient.prototype.processInit=function(e){var t=e.msg;t.erases=[];for(var r in this.interactiveMarkers)t.erases.push(r);t.poses=[],this.processUpdate(t)},ROS3D.InteractiveMarkerClient.prototype.processUpdate=function(e){var t=this;e.erases.forEach(function(e){t.eraseIntMarker(e)}),e.poses.forEach(function(e){var r=t.interactiveMarkers[e.name];r&&r.setPoseFromServer(e.pose)}),e.markers.forEach(function(e){var r=t.interactiveMarkers[e.name];r&&t.eraseIntMarker(r.name);var i=new ROS3D.InteractiveMarkerHandle({message:e,feedbackTopic:t.feedbackTopic,tfClient:t.tfClient});t.interactiveMarkers[e.name]=i;var o=new ROS3D.InteractiveMarker({handle:i,camera:t.camera,path:t.path});o.name=e.name,t.rootObject.add(o),i.on("pose",function(e){o.onServerSetPose({pose:e})}),o.addEventListener("user-pose-change",i.setPoseFromClient.bind(i)),o.addEventListener("user-mousedown",i.onMouseDown.bind(i)),o.addEventListener("user-mouseup",i.onMouseUp.bind(i)),o.addEventListener("user-button-click",i.onButtonClick.bind(i)),o.addEventListener("menu-select",i.onMenuSelect.bind(i)),i.subscribeTf()})},ROS3D.InteractiveMarkerClient.prototype.eraseIntMarker=function(e){this.interactiveMarkers[e]&&(this.rootObject.remove(this.rootObject.getChildByName(e)),delete this.interactiveMarkers[e])},ROS3D.InteractiveMarkerControl=function(e){function t(e){e.stopPropagation()}var r=this;THREE.Object3D.call(this),THREE.EventDispatcher.call(this),e=e||{},this.parent=e.parent;var i=e.message;this.name=i.name,this.camera=e.camera,this.path=e.path||"/",this.dragging=!1;var o=new THREE.Quaternion(i.orientation.x,i.orientation.y,i.orientation.z,i.orientation.w);o.normalize();var n=new THREE.Vector3(1,0,0);switch(n.applyQuaternion(o),this.currentControlOri=new THREE.Quaternion,i.interaction_mode){case ROS3D.INTERACTIVE_MARKER_MOVE_AXIS:this.addEventListener("mousemove",this.parent.moveAxis.bind(this.parent,this,n)),this.addEventListener("touchmove",this.parent.moveAxis.bind(this.parent,this,n));break;case ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS:this.addEventListener("mousemove",this.parent.rotateAxis.bind(this.parent,this,o));break;case ROS3D.INTERACTIVE_MARKER_MOVE_PLANE:this.addEventListener("mousemove",this.parent.movePlane.bind(this.parent,this,n));break;case ROS3D.INTERACTIVE_MARKER_BUTTON:this.addEventListener("click",this.parent.buttonClick.bind(this.parent,this));break;default:}i.interaction_mode!==ROS3D.INTERACTIVE_MARKER_NONE&&(this.addEventListener("mousedown",this.parent.startDrag.bind(this.parent,this)),this.addEventListener("mouseup",this.parent.stopDrag.bind(this.parent,this)),this.addEventListener("contextmenu",this.parent.showMenu.bind(this.parent,this)),this.addEventListener("mouseover",t),this.addEventListener("mouseout",t),this.addEventListener("click",t),this.addEventListener("touchstart",function(e){console.log(e.domEvent),1===e.domEvent.touches.length&&(e.type="mousedown",e.domEvent.button=0,r.dispatchEvent(e))}),this.addEventListener("touchmove",function(e){1===e.domEvent.touches.length&&(console.log(e.domEvent),e.type="mousemove",e.domEvent.button=0,r.dispatchEvent(e))}),this.addEventListener("touchend",function(e){0===e.domEvent.touches.length&&(e.domEvent.button=0,e.type="mouseup",r.dispatchEvent(e),e.type="click",r.dispatchEvent(e))}));var a=new THREE.Quaternion,s=this.parent.position.clone().multiplyScalar(-1);switch(i.orientation_mode){case ROS3D.INTERACTIVE_MARKER_INHERIT:a=this.parent.quaternion.clone().inverse(),this.updateMatrixWorld=function(e){ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(r,e),r.currentControlOri.copy(r.quaternion),r.currentControlOri.normalize()};break;case ROS3D.INTERACTIVE_MARKER_FIXED:this.updateMatrixWorld=function(e){r.useQuaternion=!0,r.quaternion=r.parent.quaternion.clone().inverse(),r.updateMatrix(),r.matrixWorldNeedsUpdate=!0,ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(r,e),r.currentControlOri.copy(r.quaternion)};break;case ROS3D.INTERACTIVE_MARKER_VIEW_FACING:var c=i.independentMarkerOrientation;this.updateMatrixWorld=function(e){r.camera.updateMatrixWorld();var t=(new THREE.Matrix4).extractRotation(r.camera.matrixWorld),i=new THREE.Matrix4,o=.5*Math.PI,n=new THREE.Vector3(-o,0,o);i.setRotationFromEuler(n);var a=new THREE.Matrix4;a.getInverse(r.parent.matrixWorld),t.multiplyMatrices(t,i),t.multiplyMatrices(a,t),r.currentControlOri.setFromRotationMatrix(t),c||(r.useQuaternion=!0,r.quaternion.copy(r.currentControlOri),r.updateMatrix(),r.matrixWorldNeedsUpdate=!0),ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(r,e)};break;default:console.error("Unkown orientation mode: "+i.orientation_mode)}i.markers.forEach(function(e){var t=new ROS3D.Marker({message:e,path:r.path});""!==e.header.frame_id&&(t.position.add(s),t.position.applyQuaternion(a),t.quaternion.multiplyQuaternions(a,t.quaternion),t.updateMatrixWorld()),r.add(t)})},ROS3D.InteractiveMarkerControl.prototype.__proto__=THREE.Object3D.prototype,ROS3D.InteractiveMarkerHandle=function(e){e=e||{},this.message=e.message,this.feedbackTopic=e.feedbackTopic,this.tfClient=e.tfClient,this.name=this.message.name,this.header=this.message.header,this.controls=this.message.controls,this.menuEntries=this.message.menu_entries,this.dragging=!1,this.timeoutHandle=null,this.tfTransform=new ROSLIB.Transform,this.pose=new ROSLIB.Pose,this.setPoseFromServer(this.message.pose)},ROS3D.InteractiveMarkerHandle.prototype.__proto__=EventEmitter2.prototype,ROS3D.InteractiveMarkerHandle.prototype.subscribeTf=function(){0===this.message.header.stamp.secs&&0===this.message.header.stamp.nsecs&&this.tfClient.subscribe(this.message.header.frame_id,this.tfUpdate.bind(this))},ROS3D.InteractiveMarkerHandle.prototype.emitServerPoseUpdate=function(){var e=new ROSLIB.Pose(this.pose);e.applyTransform(this.tfTransform),this.emit("pose",e)},ROS3D.InteractiveMarkerHandle.prototype.setPoseFromServer=function(e){this.pose=new ROSLIB.Pose(e),this.emitServerPoseUpdate()},ROS3D.InteractiveMarkerHandle.prototype.tfUpdate=function(e){this.tfTransform=new ROSLIB.Transform(e),this.emitServerPoseUpdate()},ROS3D.InteractiveMarkerHandle.prototype.setPoseFromClient=function(e){this.pose=new ROSLIB.Pose(e);var t=this.tfTransform.clone();t.rotation.invert(),this.pose.applyTransform(t),this.sendFeedback(ROS3D.INTERACTIVE_MARKER_POSE_UPDATE,void 0,0,e.controlName),this.dragging&&(this.timeoutHandle&&clearTimeout(this.timeoutHandle),this.timeoutHandle=setTimeout(this.setPoseFromClient.bind(this,e),250))},ROS3D.InteractiveMarkerHandle.prototype.onButtonClick=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK,e.clickPosition,0,e.controlName)},ROS3D.InteractiveMarkerHandle.prototype.onMouseDown=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN,e.clickPosition,0,e.controlName),this.dragging=!0},ROS3D.InteractiveMarkerHandle.prototype.onMouseUp=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_UP,e.clickPosition,0,e.controlName),this.dragging=!1,this.timeoutHandle&&clearTimeout(this.timeoutHandle)},ROS3D.InteractiveMarkerHandle.prototype.onMenuSelect=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MENU_SELECT,void 0,e.id,e.controlName)},ROS3D.InteractiveMarkerHandle.prototype.sendFeedback=function(e,t,r,i){var o=void 0!==t;t=t||{x:0,y:0,z:0};var n={header:this.header,client_id:this.clientID,marker_name:this.name,control_name:i,event_type:e,pose:this.pose,mouse_point:t,mouse_point_valid:o,menu_entry_id:r};this.feedbackTopic.publish(n)},ROS3D.InteractiveMarkerMenu=function(e){function t(e,t){this.dispatchEvent({type:"menu-select",domEvent:t,id:e.id,controlName:this.controlName}),this.hide(t)}function r(e,o){var n=document.createElement("ul");e.appendChild(n);for(var a=o.children,s=0;a.length>s;s++){var c=document.createElement("li"),l=document.createElement("div");l.appendChild(document.createTextNode(a[s].title)),n.appendChild(c),c.appendChild(l),a[s].children.length>0?(r(c,a[s]),l.addEventListener("click",i.hide.bind(i))):(l.addEventListener("click",t.bind(i,a[s])),l.className="default-interactive-marker-menu-entry")}}var i=this;e=e||{};var o=e.menuEntries,n=e.className||"default-interactive-marker-menu";e.entryClassName||"default-interactive-marker-menu-entry";var a=e.overlayClassName||"default-interactive-marker-overlay",s=[];if(s[0]={children:[]},THREE.EventDispatcher.call(this),null===document.getElementById("default-interactive-marker-menu-css")){var c=document.createElement("style");c.id="default-interactive-marker-menu-css",c.type="text/css",c.innerHTML=".default-interactive-marker-menu {background-color: #444444;border: 1px solid #888888;border: 1px solid #888888;padding: 0px 0px 0px 0px;color: #FFFFFF;font-family: sans-serif;font-size: 0.8em;z-index: 1002;}.default-interactive-marker-menu ul {padding: 0px 0px 5px 0px;margin: 0px;list-style-type: none;}.default-interactive-marker-menu ul li div {-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: default;padding: 3px 10px 3px 10px;}.default-interactive-marker-menu-entry:hover { background-color: #666666; cursor: pointer;}.default-interactive-marker-menu ul ul { font-style: italic; padding-left: 10px;}.default-interactive-marker-overlay { position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index: 1001; -moz-opacity: 0.0; opacity: .0; filter: alpha(opacity = 0);}",document.getElementsByTagName("head")[0].appendChild(c)}this.menuDomElem=document.createElement("div"),this.menuDomElem.style.position="absolute",this.menuDomElem.className=n,this.menuDomElem.addEventListener("contextmenu",function(e){e.preventDefault()}),this.overlayDomElem=document.createElement("div"),this.overlayDomElem.className=a,this.hideListener=this.hide.bind(this),this.overlayDomElem.addEventListener("contextmenu",this.hideListener),this.overlayDomElem.addEventListener("click",this.hideListener);var l,h,d;for(l=0;o.length>l;l++)h=o[l],d=h.id,s[d]={title:h.title,id:d,children:[]};for(l=0;o.length>l;l++){h=o[l],d=h.id;var p=s[d],u=s[h.parent_id];u.children.push(p)}r(this.menuDomElem,s[0])},ROS3D.InteractiveMarkerMenu.prototype.show=function(e,t){t&&t.preventDefault&&t.preventDefault(),this.controlName=e.name,this.menuDomElem.style.left=t.domEvent.clientX+"px",this.menuDomElem.style.top=t.domEvent.clientY+"px",document.body.appendChild(this.overlayDomElem),document.body.appendChild(this.menuDomElem)},ROS3D.InteractiveMarkerMenu.prototype.hide=function(e){e&&e.preventDefault&&e.preventDefault(),document.body.removeChild(this.overlayDomElem),document.body.removeChild(this.menuDomElem)},ROS3D.OccupancyGrid=function(e){e=e||{};var t=e.message,r=t.info.width,i=t.info.height,o=new THREE.PlaneGeometry(r,i),n=document.createElement("canvas");n.width=r,n.height=i;for(var a=n.getContext("2d"),s=a.createImageData(r,i),c=0;i>c;c++)for(var l=0;r>l;l++){var h,d=l+(i-c-1)*r,p=t.data[d];h=100===p?0:0===p?255:127;var u=4*(l+c*r);s.data[u]=h,s.data[++u]=h,s.data[++u]=h,s.data[++u]=255}a.putImageData(s,0,0);var E=new THREE.Texture(n);E.needsUpdate=!0;var R=new THREE.MeshBasicMaterial({map:E});R.side=THREE.DoubleSide,THREE.Mesh.call(this,o,R),this.position.x=r*t.info.resolution/2,this.position.y=i*t.info.resolution/2,this.scale.x=t.info.resolution,this.scale.y=t.info.resolution},ROS3D.OccupancyGrid.prototype.__proto__=THREE.Mesh.prototype,ROS3D.OccupancyGridClient=function(e){var t=this;e=e||{};var r=e.ros,i=e.topic||"/map";this.continuous=e.continuous,this.tfClient=e.tfClient,this.rootObject=e.rootObject||new THREE.Object3D,this.currentGrid=null;var o=new ROSLIB.Topic({ros:r,name:i,messageType:"nav_msgs/OccupancyGrid",compression:"png"});o.subscribe(function(e){t.currentGrid&&t.rootObject.remove(t.currentGrid);var r=new ROS3D.OccupancyGrid({message:e});t.currentGrid=t.tfClient?new ROS3D.SceneNode({frameID:e.header.frame_id,tfClient:t.tfClient,object:r,pose:e.info.origin}):r,t.rootObject.add(t.currentGrid),t.emit("change"),t.continuous||o.unsubscribe()})},ROS3D.OccupancyGridClient.prototype.__proto__=EventEmitter2.prototype,ROS3D.Marker=function(e){e=e||{};var t=e.path||"/",r=e.message;"/"!==t.substr(t.length-1)&&(t+="/"),THREE.Object3D.call(this),this.useQuaternion=!0,this.setPose(r.pose);var i=ROS3D.makeColorMaterial(r.color.r,r.color.g,r.color.b,r.color.a);switch(r.type){case ROS3D.MARKER_ARROW:var o,n=r.scale.x,a=.23*n,s=r.scale.y,c=.5*s,l=null;if(2===r.points.length){l=new THREE.Vector3(r.points[0].x,r.points[0].y,r.points[0].z);var h=new THREE.Vector3(r.points[1].x,r.points[1].y,r.points[1].z);o=l.clone().negate().add(h),n=o.length(),s=r.scale.y,c=r.scale.x,0!==r.scale.z&&(a=r.scale.z)}this.add(new ROS3D.Arrow({direction:o,origin:l,length:n,headLength:a,shaftDiameter:c,headDiameter:s,material:i}));break;case ROS3D.MARKER_CUBE:var d=new THREE.CubeGeometry(r.scale.x,r.scale.y,r.scale.z);this.add(new THREE.Mesh(d,i));break;case ROS3D.MARKER_SPHERE:var p=new THREE.SphereGeometry(.5),u=new THREE.Mesh(p,i);u.scale.x=r.scale.x,u.scale.y=r.scale.y,u.scale.z=r.scale.z,this.add(u);break;case ROS3D.MARKER_CYLINDER:var E=new THREE.CylinderGeometry(.5,.5,1,16,1,!1),R=new THREE.Mesh(E,i);R.useQuaternion=!0,R.quaternion.setFromAxisAngle(new THREE.Vector3(1,0,0),.5*Math.PI),R.scale=new THREE.Vector3(r.scale.x,r.scale.y,r.scale.z),this.add(R);break;case ROS3D.MARKER_CUBE_LIST:case ROS3D.MARKER_SPHERE_LIST:case ROS3D.MARKER_POINTS:var m,v=new THREE.Geometry,T=new THREE.ParticleBasicMaterial({size:r.scale.x});for(m=0;r.points.length>m;m++){var O=new THREE.Vector3;O.x=r.points[m].x,O.y=r.points[m].y,O.z=r.points[m].z,v.vertices.push(O)}if(r.colors.length===r.points.length)for(T.vertexColors=!0,m=0;r.points.length>m;m++){var f=new THREE.Color;f.setRGB(r.colors[m].r,r.colors[m].g,r.colors[m].b),v.colors.push(f)}else T.color.setRGB(r.color.r,r.color.g,r.color.b);this.add(new THREE.ParticleSystem(v,T));break;case ROS3D.MARKER_TEXT_VIEW_FACING:var S=new THREE.TextGeometry(r.text,{size:.5*r.scale.x,height:.1*r.scale.x,curveSegments:4,font:"helvetiker",bevelEnabled:!1,bevelThickness:2,bevelSize:2,material:0,extrudeMaterial:0});S.computeVertexNormals(),S.computeBoundingBox();var g=new THREE.Mesh(S,i),M=-.5*(S.boundingBox.max.x-S.boundingBox.min.x);g.position.y=-M,g.rotation.x=.5*Math.PI,g.rotation.y=1.5*Math.PI,this.add(g);break;case ROS3D.MARKER_MESH_RESOURCE:this.add(new ROS3D.MeshResource({path:t,resource:r.mesh_resource.substr(10)}));break;case ROS3D.MARKER_TRIANGLE_LIST:var b=new ROS3D.TriangleList({material:i,vertices:r.points,colors:r.colors});b.scale=new THREE.Vector3(r.scale.x,r.scale.y,r.scale.z),this.add(b);break;default:console.error("Currently unsupported marker type: "+r.type)}},ROS3D.Marker.prototype.__proto__=THREE.Object3D.prototype,ROS3D.Marker.prototype.setPose=function(e){this.position.x=e.position.x,this.position.y=e.position.y,this.position.z=e.position.z,this.quaternion=new THREE.Quaternion(e.orientation.x,e.orientation.y,e.orientation.z,e.orientation.w),this.quaternion.normalize(),this.updateMatrixWorld()},ROS3D.MarkerClient=function(e){var t=this;e=e||{};var r=e.ros,i=e.topic;this.tfClient=e.tfClient,this.rootObject=e.rootObject||new THREE.Object3D,this.currentMarker=null;var o=new ROSLIB.Topic({ros:r,name:i,messageType:"visualization_msgs/Marker",compression:"png"});o.subscribe(function(e){var r=new ROS3D.Marker({message:e});t.currentMarker&&t.rootObject.remove(t.currentMarker),t.currentMarker=new ROS3D.SceneNode({frameID:e.header.frame_id,tfClient:t.tfClient,object:r}),t.rootObject.add(t.currentMarker),t.emit("change")})},ROS3D.MarkerClient.prototype.__proto__=EventEmitter2.prototype,ROS3D.Arrow=function(e){e=e||{};var t=e.origin||new THREE.Vector3(0,0,0),r=e.direction||new THREE.Vector3(1,0,0),i=e.length||1,o=e.headLength||.2,n=e.shaftDiameter||.05,a=e.headDiameter||.1,s=e.material||new THREE.MeshBasicMaterial,c=i-o,l=new THREE.CylinderGeometry(.5*n,.5*n,c,12,1),h=new THREE.Matrix4;h.setPosition(new THREE.Vector3(0,.5*c,0)),l.applyMatrix(h);var d=new THREE.CylinderGeometry(0,.5*a,o,12,1);h.setPosition(new THREE.Vector3(0,c+.5*o,0)),d.applyMatrix(h),THREE.GeometryUtils.merge(l,d),THREE.Mesh.call(this,l,s),this.position=t,this.setDirection(r)},ROS3D.Arrow.prototype.__proto__=THREE.Mesh.prototype,ROS3D.Arrow.prototype.setDirection=function(e){var t=new THREE.Vector3(0,1,0).cross(e),r=Math.acos(new THREE.Vector3(0,1,0).dot(e.clone().normalize()));this.matrix=(new THREE.Matrix4).makeRotationAxis(t.normalize(),r),this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder)},ROS3D.Arrow.prototype.setLength=function(e){this.scale.set(e,e,e)},ROS3D.Arrow.prototype.setColor=function(e){this.line.material.color.setHex(e),this.cone.material.color.setHex(e)},ROS3D.Axes=function(e){function t(e){var t=new THREE.Color;t.setRGB(e.x,e.y,e.z);var i=new THREE.MeshBasicMaterial({color:t.getHex()}),o=new THREE.Vector3;o.crossVectors(e,new THREE.Vector3(0,-1,0));var n=new THREE.Quaternion;n.setFromAxisAngle(o,.5*Math.PI);var a=new THREE.Mesh(r.headGeom,i);a.position=e.clone(),a.position.multiplyScalar(.95),a.useQuaternion=!0,a.quaternion=n,a.updateMatrix(),r.add(a);var s=new THREE.Mesh(r.lineGeom,i);s.position=e.clone(),s.position.multiplyScalar(.45),s.useQuaternion=!0,s.quaternion=n,s.updateMatrix(),r.add(s)}var r=this;e=e||{};var i=e.shaftRadius||.008,o=e.headRadius||.023,n=e.headLength||.1;THREE.Object3D.call(this),this.lineGeom=new THREE.CylinderGeometry(i,i,1-n),this.headGeom=new THREE.CylinderGeometry(0,o,n),t(new THREE.Vector3(1,0,0)),t(new THREE.Vector3(0,1,0)),t(new THREE.Vector3(0,0,1))},ROS3D.Axes.prototype.__proto__=THREE.Object3D.prototype,ROS3D.Grid=function(e){e=e||{};var t=e.size||50,r=e.color||"#cccccc",i=e.lineWidth||1;THREE.Mesh.call(this,new THREE.PlaneGeometry(t,t,t,t),new THREE.MeshBasicMaterial({color:r,wireframe:!0,wireframeLinewidth:i,transparent:!0}))},ROS3D.Grid.prototype.__proto__=THREE.Mesh.prototype,ROS3D.MeshResource=function(e){var t=this;e=e||{};var r=e.path||"/",i=e.resource;this.warnings=e.warnings,THREE.Object3D.call(this),"/"!==r.substr(r.length-1)&&(this.path+="/");var o=r+i;if(o.substr(-4).toLowerCase(),".dae"===o.substr(-4).toLowerCase()){var n=new ColladaLoader2;n.log=function(e){t.warnings&&console.warn(e)},n.load(o,function(e){if(e.dae.asset.unit){var r=e.dae.asset.unit;e.scene.scale=new THREE.Vector3(r,r,r)}t.add(e.scene)})}},ROS3D.MeshResource.prototype.__proto__=THREE.Object3D.prototype,ROS3D.TriangleList=function(e){e=e||{};var t=e.material||new THREE.MeshBasicMaterial,r=e.vertices,i=e.colors;THREE.Object3D.call(this),t.side=THREE.DoubleSide;var o=new THREE.Geometry;for(n=0;r.length>n;n++)o.vertices.push(new THREE.Vector3(r[n].x,r[n].y,r[n].z));var n,a;if(i.length===r.length){for(n=0;r.length>n;n+=3){var s=new THREE.Face3(n,n+1,n+2);for(a=3*n;3*n+3>a;n++){var c=new THREE.Color;c.setRGB(i[n].r,i[n].g,i[n].b),s.vertexColors.push(c)}o.faces.push(h)}t.vertexColors=THREE.VertexColors}else if(i.length===r.length/3){for(n=0;r.length>n;n+=3){var l=new THREE.Face3(n,n+1,n+2);l.color.setRGB(i[n/3].r,i[n/3].g,i[n/3].b),o.faces.push(l)}t.vertexColors=THREE.FaceColors}else for(n=0;r.length>n;n+=3){var h=new THREE.Face3(n,n+1,n+2);o.faces.push(h)}o.computeBoundingBox(),o.computeBoundingSphere(),o.computeCentroids(),o.computeFaceNormals(),this.add(new THREE.Mesh(o,t))},ROS3D.TriangleList.prototype.__proto__=THREE.Object3D.prototype,ROS3D.TriangleList.prototype.setColor=function(e){this.mesh.material.color.setHex(e)},ROS3D.Urdf=function(e){e=e||{};var t=e.urdfModel,r=e.path||"/",i=e.tfClient;THREE.Object3D.call(this),this.useQuaternion=!0;var o=t.links;for(var n in o){var a=o[n];if(a.visual&&a.visual.geometry&&a.visual.geometry.type===ROSLIB.URDF_MESH){var s="/"+a.name,c=a.visual.geometry.filename,l=c.substr(-4).toLowerCase();if(".dae"===l){var h=new ROS3D.SceneNode({frameID:s,pose:a.visual.origin,tfClient:i,object:new ROS3D.MeshResource({path:r,resource:c.substring(10)})});this.add(h)}}}},ROS3D.Urdf.prototype.__proto__=THREE.Object3D.prototype,ROS3D.UrdfClient=function(e){var t=this;e=e||{};var r=e.ros,i=e.param||"robot_description";this.path=e.path||"/",this.tfClient=e.tfClient,this.rootObject=e.rootObject||new THREE.Object3D;var o=new ROSLIB.Param({ros:r,name:i});o.get(function(e){var r=new ROSLIB.UrdfModel({string:e});t.rootObject.add(new ROS3D.Urdf({urdfModel:r,path:t.path,tfClient:t.tfClient}))})},ROS3D.SceneNode=function(e){e=e||{};var t=this,r=e.tfClient,i=e.frameID,o=e.object;this.pose=e.pose||new ROSLIB.Pose,THREE.Object3D.call(this),this.useQuaternion=!0,this.add(o),this.updatePose(this.pose),r.subscribe(i,function(e){var r=new ROSLIB.Transform(e),i=new ROSLIB.Pose(t.pose);i.applyTransform(r),t.updatePose(i)})},ROS3D.SceneNode.prototype.__proto__=THREE.Object3D.prototype,ROS3D.SceneNode.prototype.updatePose=function(e){this.position.x=e.position.x,this.position.y=e.position.y,this.position.z=e.position.z,this.quaternion=new THREE.Quaternion(e.orientation.x,e.orientation.y,e.orientation.z,e.orientation.w),this.updateMatrixWorld(!0)},ROS3D.Viewer=function(e){function t(){r.cameraControls.update(),r.directionalLight.position=r.camera.localToWorld(new THREE.Vector3(-1,1,0)),r.directionalLight.position.normalize(),r.renderer.clear(!0,!0,!0),r.renderer.render(r.scene,r.camera),r.highlighter.renderHighlight(r.renderer,r.scene,r.camera),requestAnimationFrame(t)}var r=this;e=e||{};var i=e.divID,o=e.width,n=e.height,a=e.background||"#111111";e.antialias;var s=e.intensity||.66,c=e.cameraPose||{x:3,y:3,z:3};this.renderer=new THREE.WebGLRenderer({antialias:this.antialias}),this.renderer.setClearColorHex(a.replace("#","0x"),1),this.renderer.sortObjects=!1,this.renderer.setSize(o,n),this.renderer.shadowMapEnabled=!1,this.renderer.autoClear=!1,this.scene=new THREE.Scene,this.camera=new THREE.PerspectiveCamera(40,o/n,.01,1e3),this.camera.position.x=c.x,this.camera.position.y=c.y,this.camera.position.z=c.z,this.cameraControls=new ROS3D.OrbitControls({scene:this.scene,camera:this.camera}),this.cameraControls.userZoomSpeed=.5,this.scene.add(new THREE.AmbientLight(5592405)),this.directionalLight=new THREE.DirectionalLight(16777215,s),this.scene.add(this.directionalLight),this.selectableObjects=new THREE.Object3D,this.scene.add(this.selectableObjects);var l=new ROS3D.MouseHandler({renderer:this.renderer,camera:this.camera,rootObject:this.selectableObjects,fallbackTarget:this.cameraControls});this.highlighter=new ROS3D.Highlighter({mouseHandler:l}),document.getElementById(i).appendChild(this.renderer.domElement),t()},ROS3D.Viewer.prototype.addObject=function(e,t){t?this.selectableObjects.add(e):this.scene.add(e)},ROS3D.Highlighter=function(e){e=e||{};var t=e.mouseHandler;this.hoverObjs=[],t.addEventListener("mouseover",this.onMouseOver.bind(this)),t.addEventListener("mouseout",this.onMouseOut.bind(this))},ROS3D.Highlighter.prototype.onMouseOver=function(e){this.hoverObjs.push(e.currentTarget)},ROS3D.Highlighter.prototype.onMouseOut=function(e){this.hoverObjs.splice(this.hoverObjs.indexOf(e.currentTarget),1)},ROS3D.Highlighter.prototype.getWebglObjects=function(e,t,r){for(var i=e.__webglObjects,o=0;t.length>o;o++)if(t[o]){for(var n=i.length-1;n>=0;n--)if(i[n].object===t[o]){r.push(i[n]);break}this.getWebglObjects(e,t[o].children,r)}},ROS3D.Highlighter.prototype.renderHighlight=function(e,t,r){var i=[];this.getWebglObjects(t,this.hoverObjs,i),t.overrideMaterial=new THREE.MeshBasicMaterial({fog:!1,opacity:.5,depthTest:!0,depthWrite:!1,polygonOffset:!0,polygonOffsetUnits:-1,side:THREE.DoubleSide});var o=t.__webglObjects;t.__webglObjects=i,e.render(t,r),t.__webglObjects=o,t.overrideMaterial=null},ROS3D.MouseHandler=function(e){THREE.EventDispatcher.call(this),this.renderer=e.renderer,this.camera=e.camera,this.rootObject=e.rootObject,this.fallbackTarget=e.fallbackTarget,this.lastTarget=this.fallbackTarget,this.dragging=!1,this.projector=new THREE.Projector;var t=["contextmenu","click","dblclick","mouseout","mousedown","mouseup","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchcancel","touchleave","touchmove"];this.listeners={},t.forEach(function(e){this.listeners[e]=this.processDomEvent.bind(this),this.renderer.domElement.addEventListener(e,this.listeners[e],!1)},this)},ROS3D.MouseHandler.prototype.processDomEvent=function(e){e.preventDefault(); +var ROS3D=ROS3D||{REVISION:"4"};ROS3D.MARKER_ARROW=0,ROS3D.MARKER_CUBE=1,ROS3D.MARKER_SPHERE=2,ROS3D.MARKER_CYLINDER=3,ROS3D.MARKER_LINE_STRIP=4,ROS3D.MARKER_LINE_LIST=5,ROS3D.MARKER_CUBE_LIST=6,ROS3D.MARKER_SPHERE_LIST=7,ROS3D.MARKER_POINTS=8,ROS3D.MARKER_TEXT_VIEW_FACING=9,ROS3D.MARKER_MESH_RESOURCE=10,ROS3D.MARKER_TRIANGLE_LIST=11,ROS3D.INTERACTIVE_MARKER_KEEP_ALIVE=0,ROS3D.INTERACTIVE_MARKER_POSE_UPDATE=1,ROS3D.INTERACTIVE_MARKER_MENU_SELECT=2,ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK=3,ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN=4,ROS3D.INTERACTIVE_MARKER_MOUSE_UP=5,ROS3D.INTERACTIVE_MARKER_NONE=0,ROS3D.INTERACTIVE_MARKER_MENU=1,ROS3D.INTERACTIVE_MARKER_BUTTON=2,ROS3D.INTERACTIVE_MARKER_MOVE_AXIS=3,ROS3D.INTERACTIVE_MARKER_MOVE_PLANE=4,ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS=5,ROS3D.INTERACTIVE_MARKER_MOVE_ROTATE=6,ROS3D.INTERACTIVE_MARKER_INHERIT=0,ROS3D.INTERACTIVE_MARKER_FIXED=1,ROS3D.INTERACTIVE_MARKER_VIEW_FACING=2,ROS3D.makeColorMaterial=function(e,t,r,i){var o=new THREE.Color;return o.setRGB(e,t,r),.99>=i?new THREE.MeshBasicMaterial({color:o.getHex(),opacity:i+.1,transparent:!0,depthWrite:!0,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneMinusSrcAlphaFactor,blendEquation:THREE.ReverseSubtractEquation,blending:THREE.NormalBlending}):new THREE.MeshLambertMaterial({color:o.getHex(),opacity:i,blending:THREE.NormalBlending})},ROS3D.intersectPlane=function(e,t,r){var i=new THREE.Vector3,o=new THREE.Vector3;i.subVectors(t,e.origin);var n=e.direction.dot(r);if(Math.abs(n)=Math.abs(h))return void 0;var d=n*a-s*c,p=d/h;return p},ROS3D.closestAxisPoint=function(e,t,r){var i=new THREE.Projector,o=e.origin.clone();i.projectVector(o,t);var n=e.direction.clone().add(e.origin);i.projectVector(n,t);var a=n.clone().sub(o),s=new THREE.Vector2,c=s.subVectors(r,o).dot(a)/a.dot(a),l=new THREE.Vector2;l.addVectors(o,a.clone().multiplyScalar(c));var h=new THREE.Vector3(l.x,l.y,.5);i.unprojectVector(h,t);var d=new THREE.Ray(t.position,h.sub(t.position).normalize());return ROS3D.findClosestPoint(e,d)},ROS3D.InteractiveMarker=function(e){THREE.Object3D.call(this),THREE.EventDispatcher.call(this);var t=this;e=e||{};var r=e.handle;this.name=r.name;var i=e.camera,o=e.path||"/";this.dragging=!1,this.onServerSetPose({pose:r.pose}),this.dragStart={position:new THREE.Vector3,orientation:new THREE.Quaternion,positionWorld:new THREE.Vector3,orientationWorld:new THREE.Quaternion,event3d:{}},r.controls.forEach(function(e){t.add(new ROS3D.InteractiveMarkerControl({parent:t,message:e,camera:i,path:o}))}),r.menuEntries.length>0&&(this.menu=new ROS3D.InteractiveMarkerMenu({menuEntries:r.menuEntries}),this.menu.addEventListener("menu-select",function(e){t.dispatchEvent(e)}))},ROS3D.InteractiveMarker.prototype.__proto__=THREE.Object3D.prototype,ROS3D.InteractiveMarker.prototype.showMenu=function(e,t){this.menu&&this.menu.show(e,t)},ROS3D.InteractiveMarker.prototype.moveAxis=function(e,t,r){if(this.dragging){var i=e.currentControlOri,o=t.clone().applyQuaternion(i),n=this.dragStart.event3d.intersection.point,a=o.clone().applyQuaternion(this.dragStart.orientationWorld.clone()),s=new THREE.Ray(n,a),c=ROS3D.closestAxisPoint(s,r.camera,r.mousePos),l=new THREE.Vector3;l.addVectors(this.dragStart.position,o.clone().applyQuaternion(this.dragStart.orientation).multiplyScalar(c)),this.setPosition(e,l),r.stopPropagation()}},ROS3D.InteractiveMarker.prototype.movePlane=function(e,t,r){if(this.dragging){var i=e.currentControlOri,o=t.clone().applyQuaternion(i),n=this.dragStart.event3d.intersection.point,a=o.clone().applyQuaternion(this.dragStart.orientationWorld),s=ROS3D.intersectPlane(r.mouseRay,n,a),c=new THREE.Vector3;c.subVectors(s,n),c.add(this.dragStart.positionWorld),this.setPosition(e,c),r.stopPropagation()}},ROS3D.InteractiveMarker.prototype.rotateAxis=function(e,t,r){if(this.dragging){e.updateMatrixWorld();var i=e.currentControlOri,o=i.clone().multiply(t.clone()),n=new THREE.Vector3(1,0,0).applyQuaternion(o),a=this.dragStart.event3d.intersection.point,s=n.applyQuaternion(this.dragStart.orientationWorld),c=ROS3D.intersectPlane(r.mouseRay,a,s),l=new THREE.Ray(this.dragStart.positionWorld,s),h=ROS3D.intersectPlane(l,a,s),d=this.dragStart.orientationWorld.clone().multiply(o),p=d.clone().inverse();c.sub(h),c.applyQuaternion(p);var u=this.dragStart.event3d.intersection.point.clone();u.sub(h),u.applyQuaternion(p);var E=Math.atan2(c.y,c.z),R=Math.atan2(u.y,u.z),m=R-E,v=new THREE.Quaternion;v.setFromAxisAngle(n,m),this.setOrientation(e,v.multiply(this.dragStart.orientationWorld)),r.stopPropagation()}},ROS3D.InteractiveMarker.prototype.feedbackEvent=function(e,t){this.dispatchEvent({type:e,position:this.position.clone(),orientation:this.quaternion.clone(),controlName:t.name})},ROS3D.InteractiveMarker.prototype.startDrag=function(e,t){if(0===t.domEvent.button){t.stopPropagation(),this.dragging=!0,this.updateMatrixWorld(!0);var r=new THREE.Vector3;this.matrixWorld.decompose(this.dragStart.positionWorld,this.dragStart.orientationWorld,r),this.dragStart.position=this.position.clone(),this.dragStart.orientation=this.quaternion.clone(),this.dragStart.event3d=t,this.feedbackEvent("user-mousedown",e)}},ROS3D.InteractiveMarker.prototype.stopDrag=function(e,t){0===t.domEvent.button&&(t.stopPropagation(),this.dragging=!1,this.dragStart.event3d={},this.onServerSetPose(this.bufferedPoseEvent),this.bufferedPoseEvent=void 0,this.feedbackEvent("user-mouseup",e))},ROS3D.InteractiveMarker.prototype.buttonClick=function(e,t){t.stopPropagation(),this.feedbackEvent("user-button-click",e)},ROS3D.InteractiveMarker.prototype.setPosition=function(e,t){this.position=t,this.feedbackEvent("user-pose-change",e)},ROS3D.InteractiveMarker.prototype.setOrientation=function(e,t){t.normalize(),this.quaternion=t,this.feedbackEvent("user-pose-change",e)},ROS3D.InteractiveMarker.prototype.onServerSetPose=function(e){if(void 0!==e)if(this.dragging)this.bufferedPoseEvent=e;else{var t=e.pose;this.position.x=t.position.x,this.position.y=t.position.y,this.position.z=t.position.z,this.useQuaternion=!0,this.quaternion=new THREE.Quaternion(t.orientation.x,t.orientation.y,t.orientation.z,t.orientation.w),this.updateMatrixWorld(!0)}},ROS3D.InteractiveMarkerClient=function(e){e=e||{},this.ros=e.ros,this.tfClient=e.tfClient,this.topic=e.topic,this.path=e.path||"/",this.camera=e.camera,this.rootObject=e.rootObject||new THREE.Object3D,this.interactiveMarkers={},this.updateTopic=null,this.feedbackTopic=null,this.topic&&this.subscribe(this.topic)},ROS3D.InteractiveMarkerClient.prototype.subscribe=function(e){this.unsubscribe(),this.updateTopic=new ROSLIB.Topic({ros:this.ros,name:e+"/tunneled/update",messageType:"visualization_msgs/InteractiveMarkerUpdate",compression:"png"}),this.updateTopic.subscribe(this.processUpdate.bind(this)),this.feedbackTopic=new ROSLIB.Topic({ros:this.ros,name:e+"/feedback",messageType:"visualization_msgs/InteractiveMarkerFeedback",compression:"png"}),this.feedbackTopic.advertise(),this.initService=new ROSLIB.Service({ros:this.ros,name:e+"/tunneled/get_init",serviceType:"demo_interactive_markers/GetInit"});var t=new ROSLIB.ServiceRequest({});this.initService.callService(t,this.processInit.bind(this))},ROS3D.InteractiveMarkerClient.prototype.unsubscribe=function(){this.updateTopic&&this.updateTopic.unsubscribe(),this.feedbackTopic&&this.feedbackTopic.unadvertise();for(var e in this.interactiveMarkers)this.eraseIntMarker(e);this.interactiveMarkers={}},ROS3D.InteractiveMarkerClient.prototype.processInit=function(e){var t=e.msg;t.erases=[];for(var r in this.interactiveMarkers)t.erases.push(r);t.poses=[],this.processUpdate(t)},ROS3D.InteractiveMarkerClient.prototype.processUpdate=function(e){var t=this;e.erases.forEach(function(e){t.eraseIntMarker(e)}),e.poses.forEach(function(e){var r=t.interactiveMarkers[e.name];r&&r.setPoseFromServer(e.pose)}),e.markers.forEach(function(e){var r=t.interactiveMarkers[e.name];r&&t.eraseIntMarker(r.name);var i=new ROS3D.InteractiveMarkerHandle({message:e,feedbackTopic:t.feedbackTopic,tfClient:t.tfClient});t.interactiveMarkers[e.name]=i;var o=new ROS3D.InteractiveMarker({handle:i,camera:t.camera,path:t.path});o.name=e.name,t.rootObject.add(o),i.on("pose",function(e){o.onServerSetPose({pose:e})}),o.addEventListener("user-pose-change",i.setPoseFromClient.bind(i)),o.addEventListener("user-mousedown",i.onMouseDown.bind(i)),o.addEventListener("user-mouseup",i.onMouseUp.bind(i)),o.addEventListener("user-button-click",i.onButtonClick.bind(i)),o.addEventListener("menu-select",i.onMenuSelect.bind(i)),i.subscribeTf()})},ROS3D.InteractiveMarkerClient.prototype.eraseIntMarker=function(e){this.interactiveMarkers[e]&&(this.rootObject.remove(this.rootObject.getChildByName(e)),delete this.interactiveMarkers[e])},ROS3D.InteractiveMarkerControl=function(e){function t(e){e.stopPropagation()}var r=this;THREE.Object3D.call(this),THREE.EventDispatcher.call(this),e=e||{},this.parent=e.parent;var i=e.message;this.name=i.name,this.camera=e.camera,this.path=e.path||"/",this.dragging=!1;var o=new THREE.Quaternion(i.orientation.x,i.orientation.y,i.orientation.z,i.orientation.w);o.normalize();var n=new THREE.Vector3(1,0,0);switch(n.applyQuaternion(o),this.currentControlOri=new THREE.Quaternion,i.interaction_mode){case ROS3D.INTERACTIVE_MARKER_MOVE_AXIS:this.addEventListener("mousemove",this.parent.moveAxis.bind(this.parent,this,n)),this.addEventListener("touchmove",this.parent.moveAxis.bind(this.parent,this,n));break;case ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS:this.addEventListener("mousemove",this.parent.rotateAxis.bind(this.parent,this,o));break;case ROS3D.INTERACTIVE_MARKER_MOVE_PLANE:this.addEventListener("mousemove",this.parent.movePlane.bind(this.parent,this,n));break;case ROS3D.INTERACTIVE_MARKER_BUTTON:this.addEventListener("click",this.parent.buttonClick.bind(this.parent,this));break;default:}i.interaction_mode!==ROS3D.INTERACTIVE_MARKER_NONE&&(this.addEventListener("mousedown",this.parent.startDrag.bind(this.parent,this)),this.addEventListener("mouseup",this.parent.stopDrag.bind(this.parent,this)),this.addEventListener("contextmenu",this.parent.showMenu.bind(this.parent,this)),this.addEventListener("mouseover",t),this.addEventListener("mouseout",t),this.addEventListener("click",t),this.addEventListener("touchstart",function(e){console.log(e.domEvent),1===e.domEvent.touches.length&&(e.type="mousedown",e.domEvent.button=0,r.dispatchEvent(e))}),this.addEventListener("touchmove",function(e){1===e.domEvent.touches.length&&(console.log(e.domEvent),e.type="mousemove",e.domEvent.button=0,r.dispatchEvent(e))}),this.addEventListener("touchend",function(e){0===e.domEvent.touches.length&&(e.domEvent.button=0,e.type="mouseup",r.dispatchEvent(e),e.type="click",r.dispatchEvent(e))}));var a=new THREE.Quaternion,s=this.parent.position.clone().multiplyScalar(-1);switch(i.orientation_mode){case ROS3D.INTERACTIVE_MARKER_INHERIT:a=this.parent.quaternion.clone().inverse(),this.updateMatrixWorld=function(e){ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(r,e),r.currentControlOri.copy(r.quaternion),r.currentControlOri.normalize()};break;case ROS3D.INTERACTIVE_MARKER_FIXED:this.updateMatrixWorld=function(e){r.useQuaternion=!0,r.quaternion=r.parent.quaternion.clone().inverse(),r.updateMatrix(),r.matrixWorldNeedsUpdate=!0,ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(r,e),r.currentControlOri.copy(r.quaternion)};break;case ROS3D.INTERACTIVE_MARKER_VIEW_FACING:var c=i.independentMarkerOrientation;this.updateMatrixWorld=function(e){r.camera.updateMatrixWorld();var t=(new THREE.Matrix4).extractRotation(r.camera.matrixWorld),i=new THREE.Matrix4,o=.5*Math.PI,n=new THREE.Vector3(-o,0,o);i.setRotationFromEuler(n);var a=new THREE.Matrix4;a.getInverse(r.parent.matrixWorld),t.multiplyMatrices(t,i),t.multiplyMatrices(a,t),r.currentControlOri.setFromRotationMatrix(t),c||(r.useQuaternion=!0,r.quaternion.copy(r.currentControlOri),r.updateMatrix(),r.matrixWorldNeedsUpdate=!0),ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(r,e)};break;default:console.error("Unkown orientation mode: "+i.orientation_mode)}i.markers.forEach(function(e){var t=new ROS3D.Marker({message:e,path:r.path});""!==e.header.frame_id&&(t.position.add(s),t.position.applyQuaternion(a),t.quaternion.multiplyQuaternions(a,t.quaternion),t.updateMatrixWorld()),r.add(t)})},ROS3D.InteractiveMarkerControl.prototype.__proto__=THREE.Object3D.prototype,ROS3D.InteractiveMarkerHandle=function(e){e=e||{},this.message=e.message,this.feedbackTopic=e.feedbackTopic,this.tfClient=e.tfClient,this.name=this.message.name,this.header=this.message.header,this.controls=this.message.controls,this.menuEntries=this.message.menu_entries,this.dragging=!1,this.timeoutHandle=null,this.tfTransform=new ROSLIB.Transform,this.pose=new ROSLIB.Pose,this.setPoseFromServer(this.message.pose)},ROS3D.InteractiveMarkerHandle.prototype.__proto__=EventEmitter2.prototype,ROS3D.InteractiveMarkerHandle.prototype.subscribeTf=function(){0===this.message.header.stamp.secs&&0===this.message.header.stamp.nsecs&&this.tfClient.subscribe(this.message.header.frame_id,this.tfUpdate.bind(this))},ROS3D.InteractiveMarkerHandle.prototype.emitServerPoseUpdate=function(){var e=new ROSLIB.Pose(this.pose);e.applyTransform(this.tfTransform),this.emit("pose",e)},ROS3D.InteractiveMarkerHandle.prototype.setPoseFromServer=function(e){this.pose=new ROSLIB.Pose(e),this.emitServerPoseUpdate()},ROS3D.InteractiveMarkerHandle.prototype.tfUpdate=function(e){this.tfTransform=new ROSLIB.Transform(e),this.emitServerPoseUpdate()},ROS3D.InteractiveMarkerHandle.prototype.setPoseFromClient=function(e){this.pose=new ROSLIB.Pose(e);var t=this.tfTransform.clone();t.rotation.invert(),this.pose.applyTransform(t),this.sendFeedback(ROS3D.INTERACTIVE_MARKER_POSE_UPDATE,void 0,0,e.controlName),this.dragging&&(this.timeoutHandle&&clearTimeout(this.timeoutHandle),this.timeoutHandle=setTimeout(this.setPoseFromClient.bind(this,e),250))},ROS3D.InteractiveMarkerHandle.prototype.onButtonClick=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK,e.clickPosition,0,e.controlName)},ROS3D.InteractiveMarkerHandle.prototype.onMouseDown=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN,e.clickPosition,0,e.controlName),this.dragging=!0},ROS3D.InteractiveMarkerHandle.prototype.onMouseUp=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_UP,e.clickPosition,0,e.controlName),this.dragging=!1,this.timeoutHandle&&clearTimeout(this.timeoutHandle)},ROS3D.InteractiveMarkerHandle.prototype.onMenuSelect=function(e){this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MENU_SELECT,void 0,e.id,e.controlName)},ROS3D.InteractiveMarkerHandle.prototype.sendFeedback=function(e,t,r,i){var o=void 0!==t;t=t||{x:0,y:0,z:0};var n={header:this.header,client_id:this.clientID,marker_name:this.name,control_name:i,event_type:e,pose:this.pose,mouse_point:t,mouse_point_valid:o,menu_entry_id:r};this.feedbackTopic.publish(n)},ROS3D.InteractiveMarkerMenu=function(e){function t(e,t){this.dispatchEvent({type:"menu-select",domEvent:t,id:e.id,controlName:this.controlName}),this.hide(t)}function r(e,o){var n=document.createElement("ul");e.appendChild(n);for(var a=o.children,s=0;a.length>s;s++){var c=document.createElement("li"),l=document.createElement("div");l.appendChild(document.createTextNode(a[s].title)),n.appendChild(c),c.appendChild(l),a[s].children.length>0?(r(c,a[s]),l.addEventListener("click",i.hide.bind(i))):(l.addEventListener("click",t.bind(i,a[s])),l.className="default-interactive-marker-menu-entry")}}var i=this;e=e||{};var o=e.menuEntries,n=e.className||"default-interactive-marker-menu";e.entryClassName||"default-interactive-marker-menu-entry";var a=e.overlayClassName||"default-interactive-marker-overlay",s=[];if(s[0]={children:[]},THREE.EventDispatcher.call(this),null===document.getElementById("default-interactive-marker-menu-css")){var c=document.createElement("style");c.id="default-interactive-marker-menu-css",c.type="text/css",c.innerHTML=".default-interactive-marker-menu {background-color: #444444;border: 1px solid #888888;border: 1px solid #888888;padding: 0px 0px 0px 0px;color: #FFFFFF;font-family: sans-serif;font-size: 0.8em;z-index: 1002;}.default-interactive-marker-menu ul {padding: 0px 0px 5px 0px;margin: 0px;list-style-type: none;}.default-interactive-marker-menu ul li div {-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;cursor: default;padding: 3px 10px 3px 10px;}.default-interactive-marker-menu-entry:hover { background-color: #666666; cursor: pointer;}.default-interactive-marker-menu ul ul { font-style: italic; padding-left: 10px;}.default-interactive-marker-overlay { position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index: 1001; -moz-opacity: 0.0; opacity: .0; filter: alpha(opacity = 0);}",document.getElementsByTagName("head")[0].appendChild(c)}this.menuDomElem=document.createElement("div"),this.menuDomElem.style.position="absolute",this.menuDomElem.className=n,this.menuDomElem.addEventListener("contextmenu",function(e){e.preventDefault()}),this.overlayDomElem=document.createElement("div"),this.overlayDomElem.className=a,this.hideListener=this.hide.bind(this),this.overlayDomElem.addEventListener("contextmenu",this.hideListener),this.overlayDomElem.addEventListener("click",this.hideListener);var l,h,d;for(l=0;o.length>l;l++)h=o[l],d=h.id,s[d]={title:h.title,id:d,children:[]};for(l=0;o.length>l;l++){h=o[l],d=h.id;var p=s[d],u=s[h.parent_id];u.children.push(p)}r(this.menuDomElem,s[0])},ROS3D.InteractiveMarkerMenu.prototype.show=function(e,t){t&&t.preventDefault&&t.preventDefault(),this.controlName=e.name,this.menuDomElem.style.left=t.domEvent.clientX+"px",this.menuDomElem.style.top=t.domEvent.clientY+"px",document.body.appendChild(this.overlayDomElem),document.body.appendChild(this.menuDomElem)},ROS3D.InteractiveMarkerMenu.prototype.hide=function(e){e&&e.preventDefault&&e.preventDefault(),document.body.removeChild(this.overlayDomElem),document.body.removeChild(this.menuDomElem)},ROS3D.OccupancyGrid=function(e){e=e||{};var t=e.message,r=t.info.width,i=t.info.height,o=new THREE.PlaneGeometry(r,i),n=document.createElement("canvas");n.width=r,n.height=i;for(var a=n.getContext("2d"),s=a.createImageData(r,i),c=0;i>c;c++)for(var l=0;r>l;l++){var h,d=l+(i-c-1)*r,p=t.data[d];h=100===p?0:0===p?255:127;var u=4*(l+c*r);s.data[u]=h,s.data[++u]=h,s.data[++u]=h,s.data[++u]=255}a.putImageData(s,0,0);var E=new THREE.Texture(n);E.needsUpdate=!0;var R=new THREE.MeshBasicMaterial({map:E});R.side=THREE.DoubleSide,THREE.Mesh.call(this,o,R),this.position.x=r*t.info.resolution/2,this.position.y=i*t.info.resolution/2,this.scale.x=t.info.resolution,this.scale.y=t.info.resolution},ROS3D.OccupancyGrid.prototype.__proto__=THREE.Mesh.prototype,ROS3D.OccupancyGridClient=function(e){var t=this;e=e||{};var r=e.ros,i=e.topic||"/map";this.continuous=e.continuous,this.tfClient=e.tfClient,this.rootObject=e.rootObject||new THREE.Object3D,this.currentGrid=null;var o=new ROSLIB.Topic({ros:r,name:i,messageType:"nav_msgs/OccupancyGrid",compression:"png"});o.subscribe(function(e){t.currentGrid&&t.rootObject.remove(t.currentGrid);var r=new ROS3D.OccupancyGrid({message:e});t.currentGrid=t.tfClient?new ROS3D.SceneNode({frameID:e.header.frame_id,tfClient:t.tfClient,object:r,pose:e.info.origin}):r,t.rootObject.add(t.currentGrid),t.emit("change"),t.continuous||o.unsubscribe()})},ROS3D.OccupancyGridClient.prototype.__proto__=EventEmitter2.prototype,ROS3D.Marker=function(e){e=e||{};var t=e.path||"/",r=e.message;"/"!==t.substr(t.length-1)&&(t+="/"),THREE.Object3D.call(this),this.useQuaternion=!0,this.setPose(r.pose);var i=ROS3D.makeColorMaterial(r.color.r,r.color.g,r.color.b,r.color.a);switch(r.type){case ROS3D.MARKER_ARROW:var o,n=r.scale.x,a=.23*n,s=r.scale.y,c=.5*s,l=null;if(2===r.points.length){l=new THREE.Vector3(r.points[0].x,r.points[0].y,r.points[0].z);var h=new THREE.Vector3(r.points[1].x,r.points[1].y,r.points[1].z);o=l.clone().negate().add(h),n=o.length(),s=r.scale.y,c=r.scale.x,0!==r.scale.z&&(a=r.scale.z)}this.add(new ROS3D.Arrow({direction:o,origin:l,length:n,headLength:a,shaftDiameter:c,headDiameter:s,material:i}));break;case ROS3D.MARKER_CUBE:var d=new THREE.CubeGeometry(r.scale.x,r.scale.y,r.scale.z);this.add(new THREE.Mesh(d,i));break;case ROS3D.MARKER_SPHERE:var p=new THREE.SphereGeometry(.5),u=new THREE.Mesh(p,i);u.scale.x=r.scale.x,u.scale.y=r.scale.y,u.scale.z=r.scale.z,this.add(u);break;case ROS3D.MARKER_CYLINDER:var E=new THREE.CylinderGeometry(.5,.5,1,16,1,!1),R=new THREE.Mesh(E,i);R.useQuaternion=!0,R.quaternion.setFromAxisAngle(new THREE.Vector3(1,0,0),.5*Math.PI),R.scale=new THREE.Vector3(r.scale.x,r.scale.y,r.scale.z),this.add(R);break;case ROS3D.MARKER_CUBE_LIST:case ROS3D.MARKER_SPHERE_LIST:case ROS3D.MARKER_POINTS:var m,v=new THREE.Geometry,T=new THREE.ParticleBasicMaterial({size:r.scale.x});for(m=0;r.points.length>m;m++){var O=new THREE.Vector3;O.x=r.points[m].x,O.y=r.points[m].y,O.z=r.points[m].z,v.vertices.push(O)}if(r.colors.length===r.points.length)for(T.vertexColors=!0,m=0;r.points.length>m;m++){var f=new THREE.Color;f.setRGB(r.colors[m].r,r.colors[m].g,r.colors[m].b),v.colors.push(f)}else T.color.setRGB(r.color.r,r.color.g,r.color.b);this.add(new THREE.ParticleSystem(v,T));break;case ROS3D.MARKER_TEXT_VIEW_FACING:var S=new THREE.TextGeometry(r.text,{size:.5*r.scale.x,height:.1*r.scale.x,curveSegments:4,font:"helvetiker",bevelEnabled:!1,bevelThickness:2,bevelSize:2,material:0,extrudeMaterial:0});S.computeVertexNormals(),S.computeBoundingBox();var g=new THREE.Mesh(S,i),M=-.5*(S.boundingBox.max.x-S.boundingBox.min.x);g.position.y=-M,g.rotation.x=.5*Math.PI,g.rotation.y=1.5*Math.PI,this.add(g);break;case ROS3D.MARKER_MESH_RESOURCE:this.add(new ROS3D.MeshResource({path:t,resource:r.mesh_resource.substr(10)}));break;case ROS3D.MARKER_TRIANGLE_LIST:var b=new ROS3D.TriangleList({material:i,vertices:r.points,colors:r.colors});b.scale=new THREE.Vector3(r.scale.x,r.scale.y,r.scale.z),this.add(b);break;default:console.error("Currently unsupported marker type: "+r.type)}},ROS3D.Marker.prototype.__proto__=THREE.Object3D.prototype,ROS3D.Marker.prototype.setPose=function(e){this.position.x=e.position.x,this.position.y=e.position.y,this.position.z=e.position.z,this.quaternion=new THREE.Quaternion(e.orientation.x,e.orientation.y,e.orientation.z,e.orientation.w),this.quaternion.normalize(),this.updateMatrixWorld()},ROS3D.MarkerClient=function(e){var t=this;e=e||{};var r=e.ros,i=e.topic;this.tfClient=e.tfClient,this.rootObject=e.rootObject||new THREE.Object3D,this.currentMarker=null;var o=new ROSLIB.Topic({ros:r,name:i,messageType:"visualization_msgs/Marker",compression:"png"});o.subscribe(function(e){var r=new ROS3D.Marker({message:e});t.currentMarker&&t.rootObject.remove(t.currentMarker),t.currentMarker=new ROS3D.SceneNode({frameID:e.header.frame_id,tfClient:t.tfClient,object:r}),t.rootObject.add(t.currentMarker),t.emit("change")})},ROS3D.MarkerClient.prototype.__proto__=EventEmitter2.prototype,ROS3D.Arrow=function(e){e=e||{};var t=e.origin||new THREE.Vector3(0,0,0),r=e.direction||new THREE.Vector3(1,0,0),i=e.length||1,o=e.headLength||.2,n=e.shaftDiameter||.05,a=e.headDiameter||.1,s=e.material||new THREE.MeshBasicMaterial,c=i-o,l=new THREE.CylinderGeometry(.5*n,.5*n,c,12,1),h=new THREE.Matrix4;h.setPosition(new THREE.Vector3(0,.5*c,0)),l.applyMatrix(h);var d=new THREE.CylinderGeometry(0,.5*a,o,12,1);h.setPosition(new THREE.Vector3(0,c+.5*o,0)),d.applyMatrix(h),THREE.GeometryUtils.merge(l,d),THREE.Mesh.call(this,l,s),this.position=t,this.setDirection(r)},ROS3D.Arrow.prototype.__proto__=THREE.Mesh.prototype,ROS3D.Arrow.prototype.setDirection=function(e){var t=new THREE.Vector3(0,1,0).cross(e),r=Math.acos(new THREE.Vector3(0,1,0).dot(e.clone().normalize()));this.matrix=(new THREE.Matrix4).makeRotationAxis(t.normalize(),r),this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder)},ROS3D.Arrow.prototype.setLength=function(e){this.scale.set(e,e,e)},ROS3D.Arrow.prototype.setColor=function(e){this.line.material.color.setHex(e),this.cone.material.color.setHex(e)},ROS3D.Axes=function(e){function t(e){var t=new THREE.Color;t.setRGB(e.x,e.y,e.z);var i=new THREE.MeshBasicMaterial({color:t.getHex()}),o=new THREE.Vector3;o.crossVectors(e,new THREE.Vector3(0,-1,0));var n=new THREE.Quaternion;n.setFromAxisAngle(o,.5*Math.PI);var a=new THREE.Mesh(r.headGeom,i);a.position=e.clone(),a.position.multiplyScalar(.95),a.useQuaternion=!0,a.quaternion=n,a.updateMatrix(),r.add(a);var s=new THREE.Mesh(r.lineGeom,i);s.position=e.clone(),s.position.multiplyScalar(.45),s.useQuaternion=!0,s.quaternion=n,s.updateMatrix(),r.add(s)}var r=this;e=e||{};var i=e.shaftRadius||.008,o=e.headRadius||.023,n=e.headLength||.1;THREE.Object3D.call(this),this.lineGeom=new THREE.CylinderGeometry(i,i,1-n),this.headGeom=new THREE.CylinderGeometry(0,o,n),t(new THREE.Vector3(1,0,0)),t(new THREE.Vector3(0,1,0)),t(new THREE.Vector3(0,0,1))},ROS3D.Axes.prototype.__proto__=THREE.Object3D.prototype,ROS3D.Grid=function(e){e=e||{};var t=e.size||50,r=e.color||"#cccccc",i=e.lineWidth||1;THREE.Mesh.call(this,new THREE.PlaneGeometry(t,t,t,t),new THREE.MeshBasicMaterial({color:r,wireframe:!0,wireframeLinewidth:i,transparent:!0}))},ROS3D.Grid.prototype.__proto__=THREE.Mesh.prototype,ROS3D.MeshResource=function(e){var t=this;e=e||{};var r=e.path||"/",i=e.resource;this.warnings=e.warnings,THREE.Object3D.call(this),"/"!==r.substr(r.length-1)&&(this.path+="/");var o=r+i;if(o.substr(-4).toLowerCase(),".dae"===o.substr(-4).toLowerCase()){var n=new ColladaLoader2;n.log=function(e){t.warnings&&console.warn(e)},n.load(o,function(e){if(e.dae.asset.unit){var r=e.dae.asset.unit;e.scene.scale=new THREE.Vector3(r,r,r)}t.add(e.scene)})}},ROS3D.MeshResource.prototype.__proto__=THREE.Object3D.prototype,ROS3D.TriangleList=function(e){e=e||{};var t=e.material||new THREE.MeshBasicMaterial,r=e.vertices,i=e.colors;THREE.Object3D.call(this),t.side=THREE.DoubleSide;var o=new THREE.Geometry;for(n=0;r.length>n;n++)o.vertices.push(new THREE.Vector3(r[n].x,r[n].y,r[n].z));var n,a;if(i.length===r.length){for(n=0;r.length>n;n+=3){var s=new THREE.Face3(n,n+1,n+2);for(a=3*n;3*n+3>a;n++){var c=new THREE.Color;c.setRGB(i[n].r,i[n].g,i[n].b),s.vertexColors.push(c)}o.faces.push(h)}t.vertexColors=THREE.VertexColors}else if(i.length===r.length/3){for(n=0;r.length>n;n+=3){var l=new THREE.Face3(n,n+1,n+2);l.color.setRGB(i[n/3].r,i[n/3].g,i[n/3].b),o.faces.push(l)}t.vertexColors=THREE.FaceColors}else for(n=0;r.length>n;n+=3){var h=new THREE.Face3(n,n+1,n+2);o.faces.push(h)}o.computeBoundingBox(),o.computeBoundingSphere(),o.computeCentroids(),o.computeFaceNormals(),this.add(new THREE.Mesh(o,t))},ROS3D.TriangleList.prototype.__proto__=THREE.Object3D.prototype,ROS3D.TriangleList.prototype.setColor=function(e){this.mesh.material.color.setHex(e)},ROS3D.Urdf=function(e){e=e||{};var t=e.urdfModel,r=e.path||"/",i=e.tfClient;THREE.Object3D.call(this),this.useQuaternion=!0;var o=t.links;for(var n in o){var a=o[n];if(a.visual&&a.visual.geometry&&a.visual.geometry.type===ROSLIB.URDF_MESH){var s="/"+a.name,c=a.visual.geometry.filename,l=c.substr(-4).toLowerCase();if(".dae"===l){var h=new ROS3D.SceneNode({frameID:s,pose:a.visual.origin,tfClient:i,object:new ROS3D.MeshResource({path:r,resource:c.substring(10)})});this.add(h)}}}},ROS3D.Urdf.prototype.__proto__=THREE.Object3D.prototype,ROS3D.UrdfClient=function(e){var t=this;e=e||{};var r=e.ros,i=e.param||"robot_description";this.path=e.path||"/",this.tfClient=e.tfClient,this.rootObject=e.rootObject||new THREE.Object3D;var o=new ROSLIB.Param({ros:r,name:i});o.get(function(e){var r=new ROSLIB.UrdfModel({string:e});t.rootObject.add(new ROS3D.Urdf({urdfModel:r,path:t.path,tfClient:t.tfClient}))})},ROS3D.SceneNode=function(e){e=e||{};var t=this,r=e.tfClient,i=e.frameID,o=e.object;this.pose=e.pose||new ROSLIB.Pose,THREE.Object3D.call(this),this.useQuaternion=!0,this.add(o),this.updatePose(this.pose),r.subscribe(i,function(e){var r=new ROSLIB.Transform(e),i=new ROSLIB.Pose(t.pose);i.applyTransform(r),t.updatePose(i)})},ROS3D.SceneNode.prototype.__proto__=THREE.Object3D.prototype,ROS3D.SceneNode.prototype.updatePose=function(e){this.position.x=e.position.x,this.position.y=e.position.y,this.position.z=e.position.z,this.quaternion=new THREE.Quaternion(e.orientation.x,e.orientation.y,e.orientation.z,e.orientation.w),this.updateMatrixWorld(!0)},ROS3D.Viewer=function(e){function t(){r.cameraControls.update(),r.directionalLight.position=r.camera.localToWorld(new THREE.Vector3(-1,1,0)),r.directionalLight.position.normalize(),r.renderer.clear(!0,!0,!0),r.renderer.render(r.scene,r.camera),r.highlighter.renderHighlight(r.renderer,r.scene,r.camera),requestAnimationFrame(t)}var r=this;e=e||{};var i=e.divID,o=e.width,n=e.height,a=e.background||"#111111";e.antialias;var s=e.intensity||.66,c=e.cameraPose||{x:3,y:3,z:3};this.renderer=new THREE.WebGLRenderer({antialias:this.antialias}),this.renderer.setClearColorHex(a.replace("#","0x"),1),this.renderer.sortObjects=!1,this.renderer.setSize(o,n),this.renderer.shadowMapEnabled=!1,this.renderer.autoClear=!1,this.scene=new THREE.Scene,this.camera=new THREE.PerspectiveCamera(40,o/n,.01,1e3),this.camera.position.x=c.x,this.camera.position.y=c.y,this.camera.position.z=c.z,this.cameraControls=new ROS3D.OrbitControls({scene:this.scene,camera:this.camera}),this.cameraControls.userZoomSpeed=.5,this.scene.add(new THREE.AmbientLight(5592405)),this.directionalLight=new THREE.DirectionalLight(16777215,s),this.scene.add(this.directionalLight),this.selectableObjects=new THREE.Object3D,this.scene.add(this.selectableObjects);var l=new ROS3D.MouseHandler({renderer:this.renderer,camera:this.camera,rootObject:this.selectableObjects,fallbackTarget:this.cameraControls});this.highlighter=new ROS3D.Highlighter({mouseHandler:l}),document.getElementById(i).appendChild(this.renderer.domElement),t()},ROS3D.Viewer.prototype.addObject=function(e,t){t?this.selectableObjects.add(e):this.scene.add(e)},ROS3D.Highlighter=function(e){e=e||{};var t=e.mouseHandler;this.hoverObjs=[],t.addEventListener("mouseover",this.onMouseOver.bind(this)),t.addEventListener("mouseout",this.onMouseOut.bind(this))},ROS3D.Highlighter.prototype.onMouseOver=function(e){this.hoverObjs.push(e.currentTarget)},ROS3D.Highlighter.prototype.onMouseOut=function(e){this.hoverObjs.splice(this.hoverObjs.indexOf(e.currentTarget),1)},ROS3D.Highlighter.prototype.getWebglObjects=function(e,t,r){for(var i=e.__webglObjects,o=0;t.length>o;o++)if(t[o]){for(var n=i.length-1;n>=0;n--)if(i[n].object===t[o]){r.push(i[n]);break}this.getWebglObjects(e,t[o].children,r)}},ROS3D.Highlighter.prototype.renderHighlight=function(e,t,r){var i=[];this.getWebglObjects(t,this.hoverObjs,i),t.overrideMaterial=new THREE.MeshBasicMaterial({fog:!1,opacity:.5,depthTest:!0,depthWrite:!1,polygonOffset:!0,polygonOffsetUnits:-1,side:THREE.DoubleSide});var o=t.__webglObjects;t.__webglObjects=i,e.render(t,r),t.__webglObjects=o,t.overrideMaterial=null},ROS3D.MouseHandler=function(e){THREE.EventDispatcher.call(this),this.renderer=e.renderer,this.camera=e.camera,this.rootObject=e.rootObject,this.fallbackTarget=e.fallbackTarget,this.lastTarget=this.fallbackTarget,this.dragging=!1,this.projector=new THREE.Projector;var t=["contextmenu","click","dblclick","mouseout","mousedown","mouseup","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchcancel","touchleave","touchmove"];this.listeners={},t.forEach(function(e){this.listeners[e]=this.processDomEvent.bind(this),this.renderer.domElement.addEventListener(e,this.listeners[e],!1)},this)},ROS3D.MouseHandler.prototype.processDomEvent=function(e){e.preventDefault(); var t=e.target,r=t.getBoundingClientRect(),i=e.clientX-r.left-t.clientLeft+t.scrollLeft,o=e.clientY-r.top-t.clientTop+t.scrollTop,n=2*(i/t.clientWidth)-1,a=2*(-o/t.clientHeight)+1,s=new THREE.Vector3(n,a,.5);this.projector.unprojectVector(s,this.camera);var c=new THREE.Raycaster(this.camera.position.clone(),s.sub(this.camera.position).normalize()),l=c.ray,h={mousePos:new THREE.Vector2(n,a),mouseRay:l,domEvent:e,camera:this.camera,intersection:this.lastIntersection};if("mouseout"===e.type)return this.dragging&&(this.notify(this.lastTarget,"mouseup",h),this.dragging=!1),this.notify(this.lastTarget,"mouseout",h),this.lastTarget=null,void 0;if(this.dragging)return this.notify(this.lastTarget,e.type,h),("mouseup"===e.type&&2===e.button||"click"===e.type)&&(this.dragging=!1),void 0;t=this.lastTarget;var d=[];if(d=c.intersectObject(this.rootObject,!0),d.length>0?(t=d[0].object,h.intersection=this.lastIntersection=d[0]):t=this.fallbackTarget,t!==this.lastTarget){var p=this.notify(t,"mouseover",h);p?this.notify(this.lastTarget,"mouseout",h):(t=this.fallbackTarget,t!==this.lastTarget&&(this.notify(t,"mouseover",h),this.notify(this.lastTarget,"mouseout",h)))}this.notify(t,e.type,h),"mousedown"===e.type&&(this.dragging=!0),this.lastTarget=t},ROS3D.MouseHandler.prototype.notify=function(e,t,r){for(r.type=t,r.cancelBubble=!1,r.stopPropagation=function(){r.cancelBubble=!0},r.currentTarget=e;r.currentTarget;){if(r.currentTarget.dispatchEvent&&r.currentTarget.dispatchEvent instanceof Function&&(r.currentTarget.dispatchEvent(r),r.cancelBubble))return this.dispatchEvent(r),!0;r.currentTarget=r.currentTarget.parent}return!1},ROS3D.OrbitControls=function(e){function t(e){var t=e.domEvent;switch(t.preventDefault(),t.button){case 0:g=S.ROTATE,d.set(t.clientX,t.clientY);break;case 1:g=S.MOVE,T=new THREE.Vector3(0,0,1);var r=(new THREE.Matrix4).extractRotation(this.camera.matrix);T.applyMatrix4(r),v=c.center.clone(),O=c.camera.position.clone(),f=i(e.mouseRay,v,T);break;case 2:g=S.ZOOM,E.set(t.clientX,t.clientY)}this.showAxes()}function r(e){var t=e.domEvent;if(g===S.ROTATE)p.set(t.clientX,t.clientY),u.subVectors(p,d),c.rotateLeft(2*Math.PI*u.x/h*c.userRotateSpeed),c.rotateUp(2*Math.PI*u.y/h*c.userRotateSpeed),d.copy(p),this.showAxes();else if(g===S.ZOOM)R.set(t.clientX,t.clientY),m.subVectors(R,E),m.y>0?c.zoomIn():c.zoomOut(),E.copy(R),this.showAxes();else if(g===S.MOVE){var r=i(e.mouseRay,c.center,T);if(!r)return;var o=(new THREE.Vector3).subVectors(f.clone(),r.clone());c.center.addVectors(v.clone(),o.clone()),c.camera.position.addVectors(O.clone(),o.clone()),c.update(),c.camera.updateMatrixWorld(),this.showAxes()}}function i(e,t,r){var i=new THREE.Vector3,o=new THREE.Vector3;i.subVectors(t,e.origin);var n=e.direction.dot(r);if(Math.abs(n)0?c.zoomOut():c.zoomIn(),this.showAxes()}}function a(e){t(e),e.preventDefault()}function s(e){r(e),e.preventDefault()}THREE.EventDispatcher.call(this);var c=this;e=e||{};var l=e.scene;this.camera=e.camera,this.center=new THREE.Vector3,this.userZoom=!0,this.userZoomSpeed=e.userZoomSpeed||1,this.userRotate=!0,this.userRotateSpeed=e.userRotateSpeed||1,this.autoRotate=e.autoRotate,this.autoRotateSpeed=e.autoRotateSpeed||2,this.camera.up=new THREE.Vector3(0,0,1);var h=1800,d=new THREE.Vector2,p=new THREE.Vector2,u=new THREE.Vector2,E=new THREE.Vector2,R=new THREE.Vector2,m=new THREE.Vector2,v=new THREE.Vector3,T=new THREE.Vector3,O=new THREE.Vector3,f=new THREE.Vector3;this.phiDelta=0,this.thetaDelta=0,this.scale=1,this.lastPosition=new THREE.Vector3;var S={NONE:-1,ROTATE:0,ZOOM:1,MOVE:2},g=S.NONE;this.axes=new ROS3D.Axes({shaftRadius:.025,headRadius:.07,headLength:.2}),l.add(this.axes),this.axes.traverse(function(e){e.visible=!1}),this.addEventListener("mousedown",t),this.addEventListener("mouseup",o),this.addEventListener("mousemove",r),this.addEventListener("touchstart",a),this.addEventListener("touchmove",s),this.addEventListener("mousewheel",n),this.addEventListener("DOMMouseScroll",n)},ROS3D.OrbitControls.prototype.showAxes=function(){var e=this;this.axes.traverse(function(e){e.visible=!0}),this.hideTimeout&&clearTimeout(this.hideTimeout),this.hideTimeout=setTimeout(function(){e.axes.traverse(function(e){e.visible=!1}),e.hideTimeout=!1},1e3)},ROS3D.OrbitControls.prototype.rotateLeft=function(e){void 0===e&&(e=2*Math.PI/60/60*this.autoRotateSpeed),this.thetaDelta-=e},ROS3D.OrbitControls.prototype.rotateRight=function(e){void 0===e&&(e=2*Math.PI/60/60*this.autoRotateSpeed),this.thetaDelta+=e},ROS3D.OrbitControls.prototype.rotateUp=function(e){void 0===e&&(e=2*Math.PI/60/60*this.autoRotateSpeed),this.phiDelta-=e},ROS3D.OrbitControls.prototype.rotateDown=function(e){void 0===e&&(e=2*Math.PI/60/60*this.autoRotateSpeed),this.phiDelta+=e},ROS3D.OrbitControls.prototype.zoomIn=function(e){void 0===e&&(e=Math.pow(.95,this.userZoomSpeed)),this.scale/=e},ROS3D.OrbitControls.prototype.zoomOut=function(e){void 0===e&&(e=Math.pow(.95,this.userZoomSpeed)),this.scale*=e},ROS3D.OrbitControls.prototype.update=function(){var e=this.camera.position,t=e.clone().sub(this.center),r=Math.atan2(t.y,t.x),i=Math.atan2(Math.sqrt(t.y*t.y+t.x*t.x),t.z);this.autoRotate&&this.rotateLeft(2*Math.PI/60/60*this.autoRotateSpeed),r+=this.thetaDelta,i+=this.phiDelta;var o=1e-6;i=Math.max(o,Math.min(Math.PI-o,i));var n=t.length();t.y=n*Math.sin(i)*Math.sin(r),t.z=n*Math.cos(i),t.x=n*Math.sin(i)*Math.cos(r),t.multiplyScalar(this.scale),e.copy(this.center).add(t),this.camera.lookAt(this.center),n=t.length(),this.axes.position=this.center.clone(),this.axes.scale.x=this.axes.scale.y=this.axes.scale.z=.05*n,this.axes.updateMatrixWorld(!0),this.thetaDelta=0,this.phiDelta=0,this.scale=1,this.lastPosition.distanceTo(this.camera.position)>0&&(this.dispatchEvent({type:"change"}),this.lastPosition.copy(this.camera.position))}; \ No newline at end of file diff --git a/src/Ros3D.js b/src/Ros3D.js index ac7c2748..6c9cd50a 100644 --- a/src/Ros3D.js +++ b/src/Ros3D.js @@ -4,7 +4,7 @@ */ var ROS3D = ROS3D || { - REVISION : '4-devel' + REVISION : '4' }; // Marker types From 06e1659bbab4bdc600bf51b7e44f053b01667563 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Mon, 15 Apr 2013 09:13:47 -0700 Subject: [PATCH 3/7] doc rebuild --- doc/Arrow.js.html | 130 ++ doc/Axes.js.html | 119 ++ doc/Grid.js.html | 78 + doc/Highlighter.js.html | 144 ++ doc/InteractiveMarker.js.html | 350 ++++ doc/InteractiveMarkerClient.js.html | 232 +++ doc/InteractiveMarkerControl.js.html | 230 +++ doc/InteractiveMarkerHandle.js.html | 221 +++ doc/InteractiveMarkerMenu.js.html | 215 +++ doc/Marker.js.html | 240 +++ doc/MarkerClient.js.html | 104 ++ doc/MeshResource.js.html | 100 + doc/MouseHandler.js.html | 207 ++ doc/OccupancyGrid.js.html | 121 ++ doc/OccupancyGridClient.js.html | 119 ++ doc/OrbitControls.js.html | 446 +++++ doc/ROS3D.Arrow.html | 525 ++++++ doc/ROS3D.Axes.html | 305 +++ doc/ROS3D.Grid.html | 193 ++ doc/ROS3D.Highlighter.html | 699 +++++++ doc/ROS3D.InteractiveMarker.html | 1619 ++++++++++++++++ doc/ROS3D.InteractiveMarkerClient.html | 697 +++++++ doc/ROS3D.InteractiveMarkerControl.html | 306 +++ doc/ROS3D.InteractiveMarkerHandle.html | 1248 +++++++++++++ doc/ROS3D.InteractiveMarkerMenu.html | 558 ++++++ doc/ROS3D.Marker.html | 304 +++ doc/ROS3D.MarkerClient.html | 197 ++ doc/ROS3D.MeshResource.html | 194 ++ doc/ROS3D.MouseHandler.html | 460 +++++ doc/ROS3D.OccupancyGrid.html | 191 ++ doc/ROS3D.OccupancyGridClient.html | 198 ++ doc/ROS3D.OrbitControls.html | 1864 +++++++++++++++++++ doc/ROS3D.SceneNode.html | 306 +++ doc/ROS3D.TriangleList.html | 305 +++ doc/ROS3D.Urdf.html | 193 ++ doc/ROS3D.UrdfClient.html | 199 ++ doc/ROS3D.Viewer.html | 392 ++++ doc/Ros3D.js.html | 218 +++ doc/SceneNode.js.html | 108 ++ doc/TriangleList.js.html | 126 ++ doc/Urdf.js.html | 101 + doc/UrdfClient.js.html | 97 + doc/Viewer.js.html | 170 ++ doc/global.html | 175 ++ doc/index.html | 392 +--- doc/scripts/prettify/Apache-License-2.0.txt | 202 ++ doc/scripts/prettify/lang-css.js | 2 + doc/scripts/prettify/prettify.js | 28 + doc/styles/jsdoc-default.css | 283 +++ doc/styles/prettify-jsdoc.css | 111 ++ doc/styles/prettify-tomorrow.css | 132 ++ 51 files changed, 15800 insertions(+), 354 deletions(-) create mode 100644 doc/Arrow.js.html create mode 100644 doc/Axes.js.html create mode 100644 doc/Grid.js.html create mode 100644 doc/Highlighter.js.html create mode 100644 doc/InteractiveMarker.js.html create mode 100644 doc/InteractiveMarkerClient.js.html create mode 100644 doc/InteractiveMarkerControl.js.html create mode 100644 doc/InteractiveMarkerHandle.js.html create mode 100644 doc/InteractiveMarkerMenu.js.html create mode 100644 doc/Marker.js.html create mode 100644 doc/MarkerClient.js.html create mode 100644 doc/MeshResource.js.html create mode 100644 doc/MouseHandler.js.html create mode 100644 doc/OccupancyGrid.js.html create mode 100644 doc/OccupancyGridClient.js.html create mode 100644 doc/OrbitControls.js.html create mode 100644 doc/ROS3D.Arrow.html create mode 100644 doc/ROS3D.Axes.html create mode 100644 doc/ROS3D.Grid.html create mode 100644 doc/ROS3D.Highlighter.html create mode 100644 doc/ROS3D.InteractiveMarker.html create mode 100644 doc/ROS3D.InteractiveMarkerClient.html create mode 100644 doc/ROS3D.InteractiveMarkerControl.html create mode 100644 doc/ROS3D.InteractiveMarkerHandle.html create mode 100644 doc/ROS3D.InteractiveMarkerMenu.html create mode 100644 doc/ROS3D.Marker.html create mode 100644 doc/ROS3D.MarkerClient.html create mode 100644 doc/ROS3D.MeshResource.html create mode 100644 doc/ROS3D.MouseHandler.html create mode 100644 doc/ROS3D.OccupancyGrid.html create mode 100644 doc/ROS3D.OccupancyGridClient.html create mode 100644 doc/ROS3D.OrbitControls.html create mode 100644 doc/ROS3D.SceneNode.html create mode 100644 doc/ROS3D.TriangleList.html create mode 100644 doc/ROS3D.Urdf.html create mode 100644 doc/ROS3D.UrdfClient.html create mode 100644 doc/ROS3D.Viewer.html create mode 100644 doc/Ros3D.js.html create mode 100644 doc/SceneNode.js.html create mode 100644 doc/TriangleList.js.html create mode 100644 doc/Urdf.js.html create mode 100644 doc/UrdfClient.js.html create mode 100644 doc/Viewer.js.html create mode 100644 doc/global.html create mode 100644 doc/scripts/prettify/Apache-License-2.0.txt create mode 100644 doc/scripts/prettify/lang-css.js create mode 100644 doc/scripts/prettify/prettify.js create mode 100644 doc/styles/jsdoc-default.css create mode 100644 doc/styles/prettify-jsdoc.css create mode 100644 doc/styles/prettify-tomorrow.css diff --git a/doc/Arrow.js.html b/doc/Arrow.js.html new file mode 100644 index 00000000..ae19b0ae --- /dev/null +++ b/doc/Arrow.js.html @@ -0,0 +1,130 @@ + + + + + JSDoc: Source: models/Arrow.js + + + + + + + + + + +
+ +

Source: models/Arrow.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * A Arrow is a THREE object that can be used to display an arrow model.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * origin (optional) - the origin of the arrow
+ *   * direction (optional) - the direction vector of the arrow
+ *   * length (optional) - the length of the arrow
+ *   * headLength (optional) - the head length of the arrow
+ *   * shaftDiameter (optional) - the shaft diameter of the arrow
+ *   * headDiameter (optional) - the head diameter of the arrow
+ *   * material (optional) - the material to use for this arrow
+ */
+ROS3D.Arrow = function(options) {
+  options = options || {};
+  var origin = options.origin || new THREE.Vector3(0, 0, 0);
+  var direction = options.direction || new THREE.Vector3(1, 0, 0);
+  var length = options.length || 1;
+  var headLength = options.headLength || 0.2;
+  var shaftDiameter = options.shaftDiameter || 0.05;
+  var headDiameter = options.headDiameter || 0.1;
+  var material = options.material || new THREE.MeshBasicMaterial();
+
+  var shaftLength = length - headLength;
+
+  // create and merge geometry
+  var geometry = new THREE.CylinderGeometry(shaftDiameter * 0.5, shaftDiameter * 0.5, shaftLength,
+      12, 1);
+  var m = new THREE.Matrix4();
+  m.setPosition(new THREE.Vector3(0, shaftLength * 0.5, 0));
+  geometry.applyMatrix(m);
+
+  // create the head
+  var coneGeometry = new THREE.CylinderGeometry(0, headDiameter * 0.5, headLength, 12, 1);
+  m.setPosition(new THREE.Vector3(0, shaftLength + (headLength * 0.5), 0));
+  coneGeometry.applyMatrix(m);
+
+  // put the arrow together
+  THREE.GeometryUtils.merge(geometry, coneGeometry);
+
+  THREE.Mesh.call(this, geometry, material);
+
+  this.position = origin;
+  this.setDirection(direction);
+};
+ROS3D.Arrow.prototype.__proto__ = THREE.Mesh.prototype;
+
+/**
+ * Set the direction of this arrow to that of the given vector.
+ *
+ * @param direction - the direction to set this arrow
+ */
+ROS3D.Arrow.prototype.setDirection = function(direction) {
+  var axis = new THREE.Vector3(0, 1, 0).cross(direction);
+  var radians = Math.acos(new THREE.Vector3(0, 1, 0).dot(direction.clone().normalize()));
+  this.matrix = new THREE.Matrix4().makeRotationAxis(axis.normalize(), radians);
+  this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder);
+};
+
+/**
+ * Set this arrow to be the given length.
+ *
+ * @param length - the new length of the arrow
+ */
+ROS3D.Arrow.prototype.setLength = function(length) {
+  this.scale.set(length, length, length);
+};
+
+/**
+ * Set the color of this arrow to the given hex value.
+ *
+ * @param hex - the hex value of the color to use
+ */
+ROS3D.Arrow.prototype.setColor = function(hex) {
+  this.line.material.color.setHex(hex);
+  this.cone.material.color.setHex(hex);
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/Axes.js.html b/doc/Axes.js.html new file mode 100644 index 00000000..9fd3dc97 --- /dev/null +++ b/doc/Axes.js.html @@ -0,0 +1,119 @@ + + + + + JSDoc: Source: models/Axes.js + + + + + + + + + + +
+ +

Source: models/Axes.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * An Axes object can be used to display the axis of a particular coordinate frame.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * shaftRadius (optional) - the radius of the shaft to render
+ *   * headRadius (optional) - the radius of the head to render
+ *   * headLength (optional) - the length of the head to render
+ */
+ROS3D.Axes = function(options) {
+  var that = this;
+  options = options || {};
+  var shaftRadius = options.shaftRadius || 0.008;
+  var headRadius = options.headRadius || 0.023;
+  var headLength = options.headLength || 0.1;
+
+  THREE.Object3D.call(this);
+
+  // create the cylinders for the objects
+  this.lineGeom = new THREE.CylinderGeometry(shaftRadius, shaftRadius, 1.0 - headLength);
+  this.headGeom = new THREE.CylinderGeometry(0, headRadius, headLength);
+
+  /**
+   * Adds an axis marker to this axes object.
+   *
+   * @param axis - the 3D vector representing the axis to add
+   */
+  function addAxis(axis) {
+    // set the color of the axis
+    var color = new THREE.Color();
+    color.setRGB(axis.x, axis.y, axis.z);
+    var material = new THREE.MeshBasicMaterial({
+      color : color.getHex()
+    });
+
+    // setup the rotation information
+    var rotAxis = new THREE.Vector3();
+    rotAxis.crossVectors(axis, new THREE.Vector3(0, -1, 0));
+    var rot = new THREE.Quaternion();
+    rot.setFromAxisAngle(rotAxis, 0.5 * Math.PI);
+
+    // create the arrow
+    var arrow = new THREE.Mesh(that.headGeom, material);
+    arrow.position = axis.clone();
+    arrow.position.multiplyScalar(0.95);
+    arrow.useQuaternion = true;
+    arrow.quaternion = rot;
+    arrow.updateMatrix();
+    that.add(arrow);
+
+    // create the line
+    var line = new THREE.Mesh(that.lineGeom, material);
+    line.position = axis.clone();
+    line.position.multiplyScalar(0.45);
+    line.useQuaternion = true;
+    line.quaternion = rot;
+    line.updateMatrix();
+    that.add(line);
+  }
+
+  // add the three markers to the axes
+  addAxis(new THREE.Vector3(1, 0, 0));
+  addAxis(new THREE.Vector3(0, 1, 0));
+  addAxis(new THREE.Vector3(0, 0, 1));
+};
+ROS3D.Axes.prototype.__proto__ = THREE.Object3D.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/Grid.js.html b/doc/Grid.js.html new file mode 100644 index 00000000..6a3a2548 --- /dev/null +++ b/doc/Grid.js.html @@ -0,0 +1,78 @@ + + + + + JSDoc: Source: models/Grid.js + + + + + + + + + + +
+ +

Source: models/Grid.js

+ + + + + +
+
+
/**
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * Create a grid object.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * size (optional) - the size of the grid
+ *  * color (optional) - the line color of the grid, like '#cccccc'
+ *  * lineWidth (optional) - the width of the lines in the grid
+ */
+ROS3D.Grid = function(options) {
+  options = options || {};
+  var size = options.size || 50;
+  var color = options.color || '#cccccc';
+  var lineWidth = options.lineWidth || 1;
+
+  // create the mesh
+  THREE.Mesh.call(this, new THREE.PlaneGeometry(size, size, size, size),
+      new THREE.MeshBasicMaterial({
+        color : color,
+        wireframe : true,
+        wireframeLinewidth : lineWidth,
+        transparent : true
+      }));
+};
+ROS3D.Grid.prototype.__proto__ = THREE.Mesh.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/Highlighter.js.html b/doc/Highlighter.js.html new file mode 100644 index 00000000..85b391da --- /dev/null +++ b/doc/Highlighter.js.html @@ -0,0 +1,144 @@ + + + + + JSDoc: Source: visualization/interaction/Highlighter.js + + + + + + + + + + +
+ +

Source: visualization/interaction/Highlighter.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * A mouseover highlighter for 3D objects in the scene.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * mouseHandler - the handler for the mouseover and mouseout events
+ */
+ROS3D.Highlighter = function(options) {
+  options = options || {};
+  var mouseHandler = options.mouseHandler;
+  this.hoverObjs = [];
+
+  // bind the mouse events
+  mouseHandler.addEventListener('mouseover', this.onMouseOver.bind(this));
+  mouseHandler.addEventListener('mouseout', this.onMouseOut.bind(this));
+};
+
+/**
+ * Add the current target of the mouseover to the hover list.
+ *
+ * @param event - the event that contains the target of the mouseover
+ */
+ROS3D.Highlighter.prototype.onMouseOver = function(event) {
+  this.hoverObjs.push(event.currentTarget);
+};
+
+/**
+ * Remove the current target of the mouseover from the hover list.
+ *
+ * @param event - the event that contains the target of the mouseout
+ */
+ROS3D.Highlighter.prototype.onMouseOut = function(event) {
+  this.hoverObjs.splice(this.hoverObjs.indexOf(event.currentTarget), 1);
+};
+
+/**
+ * Add all corresponding webgl objects in the given scene and add them to the given render list.
+ *
+ * @param scene - the scene to check for webgl objects
+ * @param objects - the objects list to check
+ * @param renderList - the list to add to
+ */
+ROS3D.Highlighter.prototype.getWebglObjects = function(scene, objects, renderList) {
+  var objlist = scene.__webglObjects;
+  // get corresponding webgl objects
+  for ( var c = 0; c < objects.length; c++) {
+    if (objects[c]) {
+      for ( var o = objlist.length - 1; o >= 0; o--) {
+        if (objlist[o].object === objects[c]) {
+          renderList.push(objlist[o]);
+          break;
+        }
+      }
+      // recurse into children
+      this.getWebglObjects(scene, objects[c].children, renderList);
+    }
+  }
+};
+
+/**
+ * Render highlighted objects in the scene.
+ *
+ * @param renderer - the renderer to use
+ * @param scene - the scene to use
+ * @param camera - the camera to use
+ */
+ROS3D.Highlighter.prototype.renderHighlight = function(renderer, scene, camera) {
+  // get webgl objects
+  var renderList = [];
+  this.getWebglObjects(scene, this.hoverObjs, renderList);
+
+  // define highlight material
+  scene.overrideMaterial = new THREE.MeshBasicMaterial({
+    fog : false,
+    opacity : 0.5,
+    depthTest : true,
+    depthWrite : false,
+    polygonOffset : true,
+    polygonOffsetUnits : -1,
+    side : THREE.DoubleSide
+  });
+
+  // swap render lists, render, undo
+  var oldWebglObjects = scene.__webglObjects;
+  scene.__webglObjects = renderList;
+
+  renderer.render(scene, camera);
+
+  scene.__webglObjects = oldWebglObjects;
+  scene.overrideMaterial = null;
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/InteractiveMarker.js.html b/doc/InteractiveMarker.js.html new file mode 100644 index 00000000..7d3683ea --- /dev/null +++ b/doc/InteractiveMarker.js.html @@ -0,0 +1,350 @@ + + + + + JSDoc: Source: interactivemarkers/InteractiveMarker.js + + + + + + + + + + +
+ +

Source: interactivemarkers/InteractiveMarker.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * The main interactive marker object.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * handle - the ROS3D.InteractiveMarkerHandle for this marker
+ *  * camera - the main camera associated with the viewer for this marker
+ *  * path (optional) - the base path to any meshes that will be loaded
+ */
+ROS3D.InteractiveMarker = function(options) {
+  THREE.Object3D.call(this);
+  THREE.EventDispatcher.call(this);
+
+  var that = this;
+  options = options || {};
+  var handle = options.handle;
+  this.name = handle.name;
+  var camera = options.camera;
+  var path = options.path || '/';
+  this.dragging = false;
+
+  // set the initial pose
+  this.onServerSetPose({
+    pose : handle.pose
+  });
+
+  // information on where the drag started
+  this.dragStart = {
+    position : new THREE.Vector3(),
+    orientation : new THREE.Quaternion(),
+    positionWorld : new THREE.Vector3(),
+    orientationWorld : new THREE.Quaternion(),
+    event3d : {}
+  };
+
+  // add each control message
+  handle.controls.forEach(function(controlMessage) {
+    that.add(new ROS3D.InteractiveMarkerControl({
+      parent : that,
+      message : controlMessage,
+      camera : camera,
+      path : path
+    }));
+  });
+
+  // check for any menus
+  if (handle.menuEntries.length > 0) {
+    this.menu = new ROS3D.InteractiveMarkerMenu({
+      menuEntries : handle.menuEntries
+    });
+
+    // forward menu select events
+    this.menu.addEventListener('menu-select', function(event) {
+      that.dispatchEvent(event);
+    });
+  }
+};
+ROS3D.InteractiveMarker.prototype.__proto__ = THREE.Object3D.prototype;
+
+/**
+ * Show the interactive marker menu associated with this marker.
+ *
+ * @param control - the control to use
+ * @param event - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.showMenu = function(control, event) {
+  if (this.menu) {
+    this.menu.show(control, event);
+  }
+};
+
+/**
+ * Move the axis based on the given event information.
+ *
+ * @param control - the control to use
+ * @param origAxis - the origin of the axis
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.moveAxis = function(control, origAxis, event3d) {
+  if (this.dragging) {
+    var currentControlOri = control.currentControlOri;
+    var axis = origAxis.clone().applyQuaternion(currentControlOri);
+    // get move axis in world coords
+    var originWorld = this.dragStart.event3d.intersection.point;
+    var axisWorld = axis.clone().applyQuaternion(this.dragStart.orientationWorld.clone());
+
+    var axisRay = new THREE.Ray(originWorld, axisWorld);
+
+    // find closest point to mouse on axis
+    var t = ROS3D.closestAxisPoint(axisRay, event3d.camera, event3d.mousePos);
+
+    // offset from drag start position
+    var p = new THREE.Vector3();
+    p.addVectors(this.dragStart.position, axis.clone().applyQuaternion(this.dragStart.orientation)
+        .multiplyScalar(t));
+    this.setPosition(control, p);
+
+    event3d.stopPropagation();
+  }
+};
+
+/**
+ * Move with respect to the plane based on the contorl and event.
+ *
+ * @param control - the control to use
+ * @param origNormal - the normal of the origin
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.movePlane = function(control, origNormal, event3d) {
+  if (this.dragging) {
+    var currentControlOri = control.currentControlOri;
+    var normal = origNormal.clone().applyQuaternion(currentControlOri);
+    // get plane params in world coords
+    var originWorld = this.dragStart.event3d.intersection.point;
+    var normalWorld = normal.clone().applyQuaternion(this.dragStart.orientationWorld);
+
+    // intersect mouse ray with plane
+    var intersection = ROS3D.intersectPlane(event3d.mouseRay, originWorld, normalWorld);
+
+    // offset from drag start position
+    var p = new THREE.Vector3();
+    p.subVectors(intersection, originWorld);
+    p.add(this.dragStart.positionWorld);
+    this.setPosition(control, p);
+    event3d.stopPropagation();
+  }
+};
+
+/**
+ * Rotate based on the control and event given.
+ *
+ * @param control - the control to use
+ * @param origOrientation - the orientation of the origin
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.rotateAxis = function(control, origOrientation, event3d) {
+  if (this.dragging) {
+    control.updateMatrixWorld();
+
+    var currentControlOri = control.currentControlOri;
+    var orientation = currentControlOri.clone().multiply(origOrientation.clone());
+
+    var normal = (new THREE.Vector3(1, 0, 0)).applyQuaternion(orientation);
+
+    // get plane params in world coords
+    var originWorld = this.dragStart.event3d.intersection.point;
+    var normalWorld = normal.applyQuaternion(this.dragStart.orientationWorld);
+
+    // intersect mouse ray with plane
+    var intersection = ROS3D.intersectPlane(event3d.mouseRay, originWorld, normalWorld);
+
+    // offset local origin to lie on intersection plane
+    var normalRay = new THREE.Ray(this.dragStart.positionWorld, normalWorld);
+    var rotOrigin = ROS3D.intersectPlane(normalRay, originWorld, normalWorld);
+
+    // rotates from world to plane coords
+    var orientationWorld = this.dragStart.orientationWorld.clone().multiply(orientation);
+    var orientationWorldInv = orientationWorld.clone().inverse();
+
+    // rotate original and current intersection into local coords
+    intersection.sub(rotOrigin);
+    intersection.applyQuaternion(orientationWorldInv);
+
+    var origIntersection = this.dragStart.event3d.intersection.point.clone();
+    origIntersection.sub(rotOrigin);
+    origIntersection.applyQuaternion(orientationWorldInv);
+
+    // compute relative 2d angle
+    var a1 = Math.atan2(intersection.y, intersection.z);
+    var a2 = Math.atan2(origIntersection.y, origIntersection.z);
+    var a = a2 - a1;
+
+    var rot = new THREE.Quaternion();
+    rot.setFromAxisAngle(normal, a);
+
+    // rotate
+    this.setOrientation(control, rot.multiply(this.dragStart.orientationWorld));
+
+    // offset from drag start position
+    event3d.stopPropagation();
+  }
+};
+
+/**
+ * Dispatch the given event type.
+ *
+ * @param type - the type of event
+ * @param control - the control to use
+ */
+ROS3D.InteractiveMarker.prototype.feedbackEvent = function(type, control) {
+  this.dispatchEvent({
+    type : type,
+    position : this.position.clone(),
+    orientation : this.quaternion.clone(),
+    controlName : control.name
+  });
+};
+
+/**
+ * Start a drag action.
+ *
+ * @param control - the control to use
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.startDrag = function(control, event3d) {
+  if (event3d.domEvent.button === 0) {
+    event3d.stopPropagation();
+    this.dragging = true;
+    this.updateMatrixWorld(true);
+    var scale = new THREE.Vector3();
+    this.matrixWorld
+        .decompose(this.dragStart.positionWorld, this.dragStart.orientationWorld, scale);
+    this.dragStart.position = this.position.clone();
+    this.dragStart.orientation = this.quaternion.clone();
+    this.dragStart.event3d = event3d;
+
+    this.feedbackEvent('user-mousedown', control);
+  }
+};
+
+/**
+ * Stop a drag action.
+ *
+ * @param control - the control to use
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.stopDrag = function(control, event3d) {
+  if (event3d.domEvent.button === 0) {
+    event3d.stopPropagation();
+    this.dragging = false;
+    this.dragStart.event3d = {};
+    this.onServerSetPose(this.bufferedPoseEvent);
+    this.bufferedPoseEvent = undefined;
+
+    this.feedbackEvent('user-mouseup', control);
+  }
+};
+
+/**
+ * Handle a button click.
+ *
+ * @param control - the control to use
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.buttonClick = function(control, event3d) {
+  event3d.stopPropagation();
+  this.feedbackEvent('user-button-click', control);
+};
+
+/**
+ * Handle a user pose change for the position.
+ *
+ * @param control - the control to use
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.setPosition = function(control, position) {
+  this.position = position;
+  this.feedbackEvent('user-pose-change', control);
+};
+
+/**
+ * Handle a user pose change for the orientation.
+ *
+ * @param control - the control to use
+ * @param event3d - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.setOrientation = function(control, orientation) {
+  orientation.normalize();
+  this.quaternion = orientation;
+  this.feedbackEvent('user-pose-change', control);
+};
+
+/**
+ * Update the marker based when the pose is set from the server.
+ *
+ * @param event - the event that caused this
+ */
+ROS3D.InteractiveMarker.prototype.onServerSetPose = function(event) {
+  if (event !== undefined) {
+    // don't update while dragging
+    if (this.dragging) {
+      this.bufferedPoseEvent = event;
+    } else {
+      var pose = event.pose;
+
+      this.position.x = pose.position.x;
+      this.position.y = pose.position.y;
+      this.position.z = pose.position.z;
+
+      this.useQuaternion = true;
+      this.quaternion = new THREE.Quaternion(pose.orientation.x, pose.orientation.y,
+          pose.orientation.z, pose.orientation.w);
+
+      this.updateMatrixWorld(true);
+    }
+  }
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/InteractiveMarkerClient.js.html b/doc/InteractiveMarkerClient.js.html new file mode 100644 index 00000000..f36990ed --- /dev/null +++ b/doc/InteractiveMarkerClient.js.html @@ -0,0 +1,232 @@ + + + + + JSDoc: Source: interactivemarkers/InteractiveMarkerClient.js + + + + + + + + + + +
+ +

Source: interactivemarkers/InteractiveMarkerClient.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * A client for an interactive marker topic.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * ros - a handle to the ROS connection
+ *  * tfClient - a handle to the TF client
+ *  * topic (optional) - the topic to subscribe to, like '/basic_controls'
+ *  * path (optional) - the base path to any meshes that will be loaded
+ *  * camera - the main camera associated with the viewer for this marker client
+ *  * rootObject (optional) - the root THREE 3D object to render to
+ */
+ROS3D.InteractiveMarkerClient = function(options) {
+  var that = this;
+  options = options || {};
+  this.ros = options.ros;
+  this.tfClient = options.tfClient;
+  this.topic = options.topic;
+  this.path = options.path || '/';
+  this.camera = options.camera;
+  this.rootObject = options.rootObject || new THREE.Object3D();
+
+  this.interactiveMarkers = {};
+  this.updateTopic = null;
+  this.feedbackTopic = null;
+
+  // check for an initial topic
+  if (this.topic) {
+    this.subscribe(this.topic);
+  }
+};
+
+/**
+ * Subscribe to the given interactive marker topic. This will unsubscribe from any current topics.
+ *
+ * @param topic - the topic to subscribe to, like '/basic_controls'
+ */
+ROS3D.InteractiveMarkerClient.prototype.subscribe = function(topic) {
+  // unsubscribe to the other topics
+  this.unsubscribe();
+
+  this.updateTopic = new ROSLIB.Topic({
+    ros : this.ros,
+    name : topic + '/tunneled/update',
+    messageType : 'visualization_msgs/InteractiveMarkerUpdate',
+    compression : 'png'
+  });
+  this.updateTopic.subscribe(this.processUpdate.bind(this));
+
+  this.feedbackTopic = new ROSLIB.Topic({
+    ros : this.ros,
+    name : topic + '/feedback',
+    messageType : 'visualization_msgs/InteractiveMarkerFeedback',
+    compression : 'png'
+  });
+  this.feedbackTopic.advertise();
+
+  this.initService = new ROSLIB.Service({
+    ros : this.ros,
+    name : topic + '/tunneled/get_init',
+    serviceType : 'demo_interactive_markers/GetInit'
+  });
+  var request = new ROSLIB.ServiceRequest({});
+  this.initService.callService(request, this.processInit.bind(this));
+};
+
+/**
+ * Unsubscribe from the current interactive marker topic.
+ */
+ROS3D.InteractiveMarkerClient.prototype.unsubscribe = function() {
+  if (this.updateTopic) {
+    this.updateTopic.unsubscribe();
+  }
+  if (this.feedbackTopic) {
+    this.feedbackTopic.unadvertise();
+  }
+  // erase all markers
+  for (var intMarkerName in this.interactiveMarkers) {
+    this.eraseIntMarker(intMarkerName);
+  }
+  this.interactiveMarkers = {};
+};
+
+/**
+ * Process the given interactive marker initialization message.
+ *
+ * @param initMessage - the interactive marker initialization message to process
+ */
+ROS3D.InteractiveMarkerClient.prototype.processInit = function(initMessage) {
+  var message = initMessage.msg;
+
+  // erase any old markers
+  message.erases = [];
+  for (var intMarkerName in this.interactiveMarkers) {
+    message.erases.push(intMarkerName);
+  }
+  message.poses = [];
+
+  // treat it as an update
+  this.processUpdate(message);
+};
+
+/**
+ * Process the given interactive marker update message.
+ *
+ * @param initMessage - the interactive marker update message to process
+ */
+ROS3D.InteractiveMarkerClient.prototype.processUpdate = function(message) {
+  var that = this;
+
+  // erase any markers
+  message.erases.forEach(function(name) {
+    that.eraseIntMarker(name);
+  });
+
+  // updates marker poses
+  message.poses.forEach(function(poseMessage) {
+    var marker = that.interactiveMarkers[poseMessage.name];
+    if (marker) {
+      marker.setPoseFromServer(poseMessage.pose);
+    }
+  });
+
+  // add new markers
+  message.markers.forEach(function(msg) {
+    // get rid of anything with the same name
+    var oldhandle = that.interactiveMarkers[msg.name];
+    if (oldhandle) {
+      that.eraseIntMarker(oldhandle.name);
+    }
+
+    // create the handle
+    var handle = new ROS3D.InteractiveMarkerHandle({
+      message : msg,
+      feedbackTopic : that.feedbackTopic,
+      tfClient : that.tfClient
+    });
+    that.interactiveMarkers[msg.name] = handle;
+
+    // create the actual marker
+    var intMarker = new ROS3D.InteractiveMarker({
+      handle : handle,
+      camera : that.camera,
+      path : that.path
+    });
+    // add it to the scene
+    intMarker.name = msg.name;
+    that.rootObject.add(intMarker);
+
+    // listen for any pose updates from the server
+    handle.on('pose', function(pose) {
+      intMarker.onServerSetPose({
+        pose : pose
+      });
+    });
+
+    intMarker.addEventListener('user-pose-change', handle.setPoseFromClient.bind(handle));
+    intMarker.addEventListener('user-mousedown', handle.onMouseDown.bind(handle));
+    intMarker.addEventListener('user-mouseup', handle.onMouseUp.bind(handle));
+    intMarker.addEventListener('user-button-click', handle.onButtonClick.bind(handle));
+    intMarker.addEventListener('menu-select', handle.onMenuSelect.bind(handle));
+
+    // now list for any TF changes
+    handle.subscribeTf();
+  });
+};
+
+/**
+ * Erase the interactive marker with the given name.
+ *
+ * @param intMarkerName - the interactive marker name to delete
+ */
+ROS3D.InteractiveMarkerClient.prototype.eraseIntMarker = function(intMarkerName) {
+  if (this.interactiveMarkers[intMarkerName]) {
+    // remove the object
+    this.rootObject.remove(this.rootObject.getChildByName(intMarkerName));
+    delete this.interactiveMarkers[intMarkerName];
+  }
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/InteractiveMarkerControl.js.html b/doc/InteractiveMarkerControl.js.html new file mode 100644 index 00000000..a3af7fe4 --- /dev/null +++ b/doc/InteractiveMarkerControl.js.html @@ -0,0 +1,230 @@ + + + + + JSDoc: Source: interactivemarkers/InteractiveMarkerControl.js + + + + + + + + + + +
+ +

Source: interactivemarkers/InteractiveMarkerControl.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * The main marker control object for an interactive marker.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * parent - the parent of this control
+ *  * message - the interactive marker control message
+ *  * camera - the main camera associated with the viewer for this marker client
+ *  * path (optional) - the base path to any meshes that will be loaded
+ */
+ROS3D.InteractiveMarkerControl = function(options) {
+  var that = this;
+  THREE.Object3D.call(this);
+  THREE.EventDispatcher.call(this);
+
+  options = options || {};
+  this.parent = options.parent;
+  var message = options.message;
+  this.name = message.name;
+  this.camera = options.camera;
+  this.path = options.path || '/';
+  this.dragging = false;
+
+  // orientation for the control
+  var controlOri = new THREE.Quaternion(message.orientation.x, message.orientation.y,
+      message.orientation.z, message.orientation.w);
+  controlOri.normalize();
+
+  // transform x axis into local frame
+  var controlAxis = new THREE.Vector3(1, 0, 0);
+  controlAxis.applyQuaternion(controlOri);
+
+  this.currentControlOri = new THREE.Quaternion();
+
+  // determine mouse interaction
+  switch (message.interaction_mode) {
+    case ROS3D.INTERACTIVE_MARKER_MOVE_AXIS:
+      this.addEventListener('mousemove', this.parent.moveAxis.bind(this.parent, this, controlAxis));
+      this.addEventListener('touchmove', this.parent.moveAxis.bind(this.parent, this, controlAxis));
+      break;
+    case ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS:
+      this
+          .addEventListener('mousemove', this.parent.rotateAxis.bind(this.parent, this, controlOri));
+      break;
+    case ROS3D.INTERACTIVE_MARKER_MOVE_PLANE:
+      this
+          .addEventListener('mousemove', this.parent.movePlane.bind(this.parent, this, controlAxis));
+      break;
+    case ROS3D.INTERACTIVE_MARKER_BUTTON:
+      this.addEventListener('click', this.parent.buttonClick.bind(this.parent, this));
+      break;
+    default:
+      break;
+  }
+
+  /**
+   * Install default listeners for highlighting / dragging.
+   *
+   * @param event - the event to stop
+   */
+  function stopPropagation(event) {
+    event.stopPropagation();
+  }
+
+  // check the mode
+  if (message.interaction_mode !== ROS3D.INTERACTIVE_MARKER_NONE) {
+    this.addEventListener('mousedown', this.parent.startDrag.bind(this.parent, this));
+    this.addEventListener('mouseup', this.parent.stopDrag.bind(this.parent, this));
+    this.addEventListener('contextmenu', this.parent.showMenu.bind(this.parent, this));
+    this.addEventListener('mouseover', stopPropagation);
+    this.addEventListener('mouseout', stopPropagation);
+    this.addEventListener('click', stopPropagation);
+
+    // touch support
+    this.addEventListener('touchstart', function(event3d) {
+      console.log(event3d.domEvent);
+      if (event3d.domEvent.touches.length === 1) {
+        event3d.type = 'mousedown';
+        event3d.domEvent.button = 0;
+        that.dispatchEvent(event3d);
+      }
+    });
+    this.addEventListener('touchmove', function(event3d) {
+      if (event3d.domEvent.touches.length === 1) {
+        console.log(event3d.domEvent);
+        event3d.type = 'mousemove';
+        event3d.domEvent.button = 0;
+        that.dispatchEvent(event3d);
+      }
+    });
+    this.addEventListener('touchend', function(event3d) {
+      if (event3d.domEvent.touches.length === 0) {
+        event3d.domEvent.button = 0;
+        event3d.type = 'mouseup';
+        that.dispatchEvent(event3d);
+        event3d.type = 'click';
+        that.dispatchEvent(event3d);
+      }
+    });
+  }
+
+  // rotation behavior
+  var rotInv = new THREE.Quaternion();
+  var posInv = this.parent.position.clone().multiplyScalar(-1);
+  switch (message.orientation_mode) {
+    case ROS3D.INTERACTIVE_MARKER_INHERIT:
+      rotInv = this.parent.quaternion.clone().inverse();
+      this.updateMatrixWorld = function(force) {
+        ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force);
+        that.currentControlOri.copy(that.quaternion);
+        that.currentControlOri.normalize();
+      };
+      break;
+    case ROS3D.INTERACTIVE_MARKER_FIXED:
+      this.updateMatrixWorld = function(force) {
+        that.useQuaternion = true;
+        that.quaternion = that.parent.quaternion.clone().inverse();
+        that.updateMatrix();
+        that.matrixWorldNeedsUpdate = true;
+        ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force);
+        that.currentControlOri.copy(that.quaternion);
+      };
+      break;
+    case ROS3D.INTERACTIVE_MARKER_VIEW_FACING:
+      var independentMarkerOrientation = message.independentMarkerOrientation;
+      this.updateMatrixWorld = function(force) {
+        that.camera.updateMatrixWorld();
+        var cameraRot = new THREE.Matrix4().extractRotation(that.camera.matrixWorld);
+
+        var ros2Gl = new THREE.Matrix4();
+        var r90 = Math.PI * 0.5;
+        var rv = new THREE.Vector3(-r90, 0, r90);
+        ros2Gl.setRotationFromEuler(rv);
+
+        var worldToLocal = new THREE.Matrix4();
+        worldToLocal.getInverse(that.parent.matrixWorld);
+
+        cameraRot.multiplyMatrices(cameraRot, ros2Gl);
+        cameraRot.multiplyMatrices(worldToLocal, cameraRot);
+
+        that.currentControlOri.setFromRotationMatrix(cameraRot);
+
+        // check the orientation
+        if (!independentMarkerOrientation) {
+          that.useQuaternion = true;
+          that.quaternion.copy(that.currentControlOri);
+          that.updateMatrix();
+          that.matrixWorldNeedsUpdate = true;
+        }
+        ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force);
+      };
+      break;
+    default:
+      console.error('Unkown orientation mode: ' + message.orientation_mode);
+      break;
+  }
+
+  // create visuals (markers)
+  message.markers.forEach(function(markerMsg) {
+    var markerHelper = new ROS3D.Marker({
+      message : markerMsg,
+      path : that.path
+    });
+
+    if (markerMsg.header.frame_id !== '') {
+      // if the marker lives in its own coordinate frame, convert position into IM's local frame
+      markerHelper.position.add(posInv);
+      markerHelper.position.applyQuaternion(rotInv);
+      markerHelper.quaternion.multiplyQuaternions(rotInv, markerHelper.quaternion);
+      markerHelper.updateMatrixWorld();
+    }
+
+    // add the marker
+    that.add(markerHelper);
+  });
+};
+ROS3D.InteractiveMarkerControl.prototype.__proto__ = THREE.Object3D.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/InteractiveMarkerHandle.js.html b/doc/InteractiveMarkerHandle.js.html new file mode 100644 index 00000000..06a1ccef --- /dev/null +++ b/doc/InteractiveMarkerHandle.js.html @@ -0,0 +1,221 @@ + + + + + JSDoc: Source: interactivemarkers/InteractiveMarkerHandle.js + + + + + + + + + + +
+ +

Source: interactivemarkers/InteractiveMarkerHandle.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * Handle with signals for a single interactive marker.
+ *
+ * Emits the following events:
+ *  * 'pose' - emitted when a new pose comes from the server
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * message - the interactive marker message
+ *  * feedbackTopic - the ROSLIB.Topic associated with the feedback
+ *  * tfClient - a handle to the TF client to use
+ */
+ROS3D.InteractiveMarkerHandle = function(options) {
+  options = options || {};
+  this.message = options.message;
+  this.feedbackTopic = options.feedbackTopic;
+  this.tfClient = options.tfClient;
+  this.name = this.message.name;
+  this.header = this.message.header;
+  this.controls = this.message.controls;
+  this.menuEntries = this.message.menu_entries;
+  this.dragging = false;
+  this.timeoutHandle = null;
+  this.tfTransform = new ROSLIB.Transform();
+  this.pose = new ROSLIB.Pose();
+
+  // start by setting the pose
+  this.setPoseFromServer(this.message.pose);
+};
+ROS3D.InteractiveMarkerHandle.prototype.__proto__ = EventEmitter2.prototype;
+
+/**
+ * Subscribe to the TF associated with this interactive marker.
+ */
+ROS3D.InteractiveMarkerHandle.prototype.subscribeTf = function() {
+  // subscribe to tf updates if frame-fixed
+  if (this.message.header.stamp.secs === 0.0 && this.message.header.stamp.nsecs === 0.0) {
+    this.tfClient.subscribe(this.message.header.frame_id, this.tfUpdate.bind(this));
+  }
+};
+
+/**
+ * Emit the new pose that has come from the server.
+ */
+ROS3D.InteractiveMarkerHandle.prototype.emitServerPoseUpdate = function() {
+  var poseTransformed = new ROSLIB.Pose(this.pose);
+  poseTransformed.applyTransform(this.tfTransform);
+  this.emit('pose', poseTransformed);
+};
+
+/**
+ * Update the pose based on the pose given by the server.
+ *
+ * @param poseMsg - the pose given by the server
+ */
+ROS3D.InteractiveMarkerHandle.prototype.setPoseFromServer = function(poseMsg) {
+  this.pose = new ROSLIB.Pose(poseMsg);
+  this.emitServerPoseUpdate();
+};
+
+/**
+ * Update the pose based on the TF given by the server.
+ *
+ * @param transformMsg - the TF given by the server
+ */
+ROS3D.InteractiveMarkerHandle.prototype.tfUpdate = function(transformMsg) {
+  this.tfTransform = new ROSLIB.Transform(transformMsg);
+  this.emitServerPoseUpdate();
+};
+
+/**
+ * Set the pose from the client based on the given event.
+ *
+ * @param event - the event to base the change off of
+ */
+ROS3D.InteractiveMarkerHandle.prototype.setPoseFromClient = function(event) {
+  // apply the transform
+  this.pose = new ROSLIB.Pose(event);
+  var inv = this.tfTransform.clone();
+  inv.rotation.invert();
+  this.pose.applyTransform(inv);
+
+  // send feedback to the server
+  this.sendFeedback(ROS3D.INTERACTIVE_MARKER_POSE_UPDATE, undefined, 0, event.controlName);
+
+  // keep sending pose feedback until the mouse goes up
+  if (this.dragging) {
+    if (this.timeoutHandle) {
+      clearTimeout(this.timeoutHandle);
+    }
+    this.timeoutHandle = setTimeout(this.setPoseFromClient.bind(this, event), 250);
+  }
+};
+
+/**
+ * Send the button click feedback to the server.
+ *
+ * @param event - the event associated with the button click
+ */
+ROS3D.InteractiveMarkerHandle.prototype.onButtonClick = function(event) {
+  this.sendFeedback(ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK, event.clickPosition, 0,
+      event.controlName);
+};
+
+/**
+ * Send the mousedown feedback to the server.
+ *
+ * @param event - the event associated with the mousedown
+ */
+ROS3D.InteractiveMarkerHandle.prototype.onMouseDown = function(event) {
+  this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN, event.clickPosition, 0, event.controlName);
+  this.dragging = true;
+};
+
+/**
+ * Send the mouseup feedback to the server.
+ *
+ * @param event - the event associated with the mouseup
+ */
+ROS3D.InteractiveMarkerHandle.prototype.onMouseUp = function(event) {
+  this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_UP, event.clickPosition, 0, event.controlName);
+  this.dragging = false;
+  if (this.timeoutHandle) {
+    clearTimeout(this.timeoutHandle);
+  }
+};
+
+/**
+ * Send the menu select feedback to the server.
+ *
+ * @param event - the event associated with the menu select
+ */
+ROS3D.InteractiveMarkerHandle.prototype.onMenuSelect = function(event) {
+  this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MENU_SELECT, undefined, event.id, event.controlName);
+};
+
+/**
+ * Send feedback to the interactive marker server.
+ *
+ * @param eventType - the type of event that happened
+ * @param clickPosition (optional) - the position in ROS space the click happened
+ * @param menuEntryID (optional) - the menu entry ID that is associated
+ * @param controlName - the name of the control
+ */
+ROS3D.InteractiveMarkerHandle.prototype.sendFeedback = function(eventType, clickPosition,
+    menuEntryID, controlName) {
+
+  // check for the click position
+  var mousePointValid = clickPosition !== undefined;
+  clickPosition = clickPosition || {
+    x : 0,
+    y : 0,
+    z : 0
+  };
+
+  var feedback = {
+    header : this.header,
+    client_id : this.clientID,
+    marker_name : this.name,
+    control_name : controlName,
+    event_type : eventType,
+    pose : this.pose,
+    mouse_point : clickPosition,
+    mouse_point_valid : mousePointValid,
+    menu_entry_id : menuEntryID
+  };
+  this.feedbackTopic.publish(feedback);
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/InteractiveMarkerMenu.js.html b/doc/InteractiveMarkerMenu.js.html new file mode 100644 index 00000000..5cd20b2e --- /dev/null +++ b/doc/InteractiveMarkerMenu.js.html @@ -0,0 +1,215 @@ + + + + + JSDoc: Source: interactivemarkers/InteractiveMarkerMenu.js + + + + + + + + + + +
+ +

Source: interactivemarkers/InteractiveMarkerMenu.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * A menu for an interactive marker. This will be overlayed on the canvas.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * menuEntries - the menu entries to add
+ *  * className (optional) - a custom CSS class for the menu div
+ *  * entryClassName (optional) - a custom CSS class for the menu entry
+ *  * overlayClassName (optional) - a  custom CSS class for the menu overlay
+ */
+ROS3D.InteractiveMarkerMenu = function(options) {
+  var that = this;
+  options = options || {};
+  var menuEntries = options.menuEntries;
+  var className = options.className || 'default-interactive-marker-menu';
+  var entryClassName = options.entryClassName || 'default-interactive-marker-menu-entry';
+  var overlayClassName = options.overlayClassName || 'default-interactive-marker-overlay';
+
+  // holds the menu tree
+  var allMenus = [];
+  allMenus[0] = {
+    children : []
+  };
+
+  THREE.EventDispatcher.call(this);
+
+  // create the CSS for this marker if it has not been created
+  if (document.getElementById('default-interactive-marker-menu-css') === null) {
+    var style = document.createElement('style');
+    style.id = 'default-interactive-marker-menu-css';
+    style.type = 'text/css';
+    style.innerHTML = '.default-interactive-marker-menu {' + 'background-color: #444444;'
+        + 'border: 1px solid #888888;' + 'border: 1px solid #888888;' + 'padding: 0px 0px 0px 0px;'
+        + 'color: #FFFFFF;' + 'font-family: sans-serif;' + 'font-size: 0.8em;' + 'z-index: 1002;'
+        + '}' + '.default-interactive-marker-menu ul {' + 'padding: 0px 0px 5px 0px;'
+        + 'margin: 0px;' + 'list-style-type: none;' + '}'
+        + '.default-interactive-marker-menu ul li div {' + '-webkit-touch-callout: none;'
+        + '-webkit-user-select: none;' + '-khtml-user-select: none;' + '-moz-user-select: none;'
+        + '-ms-user-select: none;' + 'user-select: none;' + 'cursor: default;'
+        + 'padding: 3px 10px 3px 10px;' + '}' + '.default-interactive-marker-menu-entry:hover {'
+        + '  background-color: #666666;' + '  cursor: pointer;' + '}'
+        + '.default-interactive-marker-menu ul ul {' + '  font-style: italic;'
+        + '  padding-left: 10px;' + '}' + '.default-interactive-marker-overlay {'
+        + '  position: absolute;' + '  top: 0%;' + '  left: 0%;' + '  width: 100%;'
+        + '  height: 100%;' + '  background-color: black;' + '  z-index: 1001;'
+        + '  -moz-opacity: 0.0;' + '  opacity: .0;' + '  filter: alpha(opacity = 0);' + '}';
+    document.getElementsByTagName('head')[0].appendChild(style);
+  }
+
+  // place the menu in a div
+  this.menuDomElem = document.createElement('div');
+  this.menuDomElem.style.position = 'absolute';
+  this.menuDomElem.className = className;
+  this.menuDomElem.addEventListener('contextmenu', function(event) {
+    event.preventDefault();
+  });
+
+  // create the overlay DOM
+  this.overlayDomElem = document.createElement('div');
+  this.overlayDomElem.className = overlayClassName;
+
+  this.hideListener = this.hide.bind(this);
+  this.overlayDomElem.addEventListener('contextmenu', this.hideListener);
+  this.overlayDomElem.addEventListener('click', this.hideListener);
+
+  // parse all entries and link children to parents
+  var i, entry, id;
+  for ( i = 0; i < menuEntries.length; i++) {
+    entry = menuEntries[i];
+    id = entry.id;
+    allMenus[id] = {
+      title : entry.title,
+      id : id,
+      children : []
+    };
+  }
+  for ( i = 0; i < menuEntries.length; i++) {
+    entry = menuEntries[i];
+    id = entry.id;
+    var menu = allMenus[id];
+    var parent = allMenus[entry.parent_id];
+    parent.children.push(menu);
+  }
+
+  function emitMenuSelect(menuEntry, domEvent) {
+    this.dispatchEvent({
+      type : 'menu-select',
+      domEvent : domEvent,
+      id : menuEntry.id,
+      controlName : this.controlName
+    });
+    this.hide(domEvent);
+  }
+
+  /**
+   * Create the HTML UL element for the menu and link it to the parent.
+   *
+   * @param parentDomElem - the parent DOM element
+   * @param parentMenu - the parent menu
+   */
+  function makeUl(parentDomElem, parentMenu) {
+
+    var ulElem = document.createElement('ul');
+    parentDomElem.appendChild(ulElem);
+
+    var children = parentMenu.children;
+
+    for ( var i = 0; i < children.length; i++) {
+      var liElem = document.createElement('li');
+      var divElem = document.createElement('div');
+      divElem.appendChild(document.createTextNode(children[i].title));
+      ulElem.appendChild(liElem);
+      liElem.appendChild(divElem);
+
+      if (children[i].children.length > 0) {
+        makeUl(liElem, children[i]);
+        divElem.addEventListener('click', that.hide.bind(that));
+      } else {
+        divElem.addEventListener('click', emitMenuSelect.bind(that, children[i]));
+        divElem.className = 'default-interactive-marker-menu-entry';
+      }
+    }
+
+  }
+
+  // construct DOM element
+  makeUl(this.menuDomElem, allMenus[0]);
+};
+
+/**
+ * Shoe the menu DOM element.
+ *
+ * @param control - the control for the menu
+ * @param event - the event that caused this
+ */
+ROS3D.InteractiveMarkerMenu.prototype.show = function(control, event) {
+  if (event && event.preventDefault) {
+    event.preventDefault();
+  }
+
+  this.controlName = control.name;
+
+  // position it on the click
+  this.menuDomElem.style.left = event.domEvent.clientX + 'px';
+  this.menuDomElem.style.top = event.domEvent.clientY + 'px';
+  document.body.appendChild(this.overlayDomElem);
+  document.body.appendChild(this.menuDomElem);
+};
+
+/**
+ * Hide the menu DOM element.
+ *
+ * @param event (optional) - the event that caused this
+ */
+ROS3D.InteractiveMarkerMenu.prototype.hide = function(event) {
+  if (event && event.preventDefault) {
+    event.preventDefault();
+  }
+
+  document.body.removeChild(this.overlayDomElem);
+  document.body.removeChild(this.menuDomElem);
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/Marker.js.html b/doc/Marker.js.html new file mode 100644 index 00000000..bebf35e0 --- /dev/null +++ b/doc/Marker.js.html @@ -0,0 +1,240 @@ + + + + + JSDoc: Source: markers/Marker.js + + + + + + + + + + +
+ +

Source: markers/Marker.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * A Marker can convert a ROS marker message into a THREE object.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * path - the base path or URL for any mesh files that will be loaded for this marker
+ *   * message - the marker message
+ */
+ROS3D.Marker = function(options) {
+  options = options || {};
+  var path = options.path || '/';
+  var message = options.message;
+
+  // check for a trailing '/'
+  if (path.substr(path.length - 1) !== '/') {
+    path += '/';
+  }
+
+  THREE.Object3D.call(this);
+  this.useQuaternion = true;
+
+  // set the pose and get the color
+  this.setPose(message.pose);
+  var colorMaterial = ROS3D.makeColorMaterial(message.color.r, message.color.g, message.color.b,
+      message.color.a);
+
+  // create the object based on the type
+  switch (message.type) {
+    case ROS3D.MARKER_ARROW:
+      // get the sizes for the arrow
+      var len = message.scale.x;
+      var headLength = len * 0.23;
+      var headDiameter = message.scale.y;
+      var shaftDiameter = headDiameter * 0.5;
+
+      // determine the points
+      var direction, p1 = null;
+      if (message.points.length === 2) {
+        p1 = new THREE.Vector3(message.points[0].x, message.points[0].y, message.points[0].z);
+        var p2 = new THREE.Vector3(message.points[1].x, message.points[1].y, message.points[1].z);
+        direction = p1.clone().negate().add(p2);
+        // direction = p2 - p1;
+        len = direction.length();
+        headDiameter = message.scale.y;
+        shaftDiameter = message.scale.x;
+
+        if (message.scale.z !== 0.0) {
+          headLength = message.scale.z;
+        }
+      }
+
+      // add the marker
+      this.add(new ROS3D.Arrow({
+        direction : direction,
+        origin : p1,
+        length : len,
+        headLength : headLength,
+        shaftDiameter : shaftDiameter,
+        headDiameter : headDiameter,
+        material : colorMaterial
+      }));
+      break;
+    case ROS3D.MARKER_CUBE:
+      // set the cube dimensions
+      var cubeGeom = new THREE.CubeGeometry(message.scale.x, message.scale.y, message.scale.z);
+      this.add(new THREE.Mesh(cubeGeom, colorMaterial));
+      break;
+    case ROS3D.MARKER_SPHERE:
+      // set the sphere dimensions
+      var sphereGeom = new THREE.SphereGeometry(0.5);
+      var sphereMesh = new THREE.Mesh(sphereGeom, colorMaterial);
+      sphereMesh.scale.x = message.scale.x;
+      sphereMesh.scale.y = message.scale.y;
+      sphereMesh.scale.z = message.scale.z;
+      this.add(sphereMesh);
+      break;
+    case ROS3D.MARKER_CYLINDER:
+      // set the cylinder dimensions
+      var cylinderGeom = new THREE.CylinderGeometry(0.5, 0.5, 1, 16, 1, false);
+      var cylinderMesh = new THREE.Mesh(cylinderGeom, colorMaterial);
+      cylinderMesh.useQuaternion = true;
+      cylinderMesh.quaternion.setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI * 0.5);
+      cylinderMesh.scale = new THREE.Vector3(message.scale.x, message.scale.y, message.scale.z);
+      this.add(cylinderMesh);
+      break;
+    case ROS3D.MARKER_CUBE_LIST:
+    case ROS3D.MARKER_SPHERE_LIST:
+    case ROS3D.MARKER_POINTS:
+      // for now, use a particle system for the lists
+      var geometry = new THREE.Geometry();
+      var material = new THREE.ParticleBasicMaterial({
+        size : message.scale.x
+      });
+
+      // add the points
+      var i;
+      for ( i = 0; i < message.points.length; i++) {
+        var vertex = new THREE.Vector3();
+        vertex.x = message.points[i].x;
+        vertex.y = message.points[i].y;
+        vertex.z = message.points[i].z;
+        geometry.vertices.push(vertex);
+      }
+
+      // determine the colors for each
+      if (message.colors.length === message.points.length) {
+        material.vertexColors = true;
+        for ( i = 0; i < message.points.length; i++) {
+          var color = new THREE.Color();
+          color.setRGB(message.colors[i].r, message.colors[i].g, message.colors[i].b);
+          geometry.colors.push(color);
+        }
+      } else {
+        material.color.setRGB(message.color.r, message.color.g, message.color.b);
+      }
+
+      // add the particle system
+      this.add(new THREE.ParticleSystem(geometry, material));
+      break;
+    case ROS3D.MARKER_TEXT_VIEW_FACING:
+      // setup the text
+      var textGeo = new THREE.TextGeometry(message.text, {
+        size : message.scale.x * 0.5,
+        height : 0.1 * message.scale.x,
+        curveSegments : 4,
+        font : 'helvetiker',
+        bevelEnabled : false,
+        bevelThickness : 2,
+        bevelSize : 2,
+        material : 0,
+        extrudeMaterial : 0
+      });
+      textGeo.computeVertexNormals();
+      textGeo.computeBoundingBox();
+
+      // position the text and add it
+      var mesh = new THREE.Mesh(textGeo, colorMaterial);
+      var centerOffset = -0.5 * (textGeo.boundingBox.max.x - textGeo.boundingBox.min.x);
+      mesh.position.y = -centerOffset;
+      mesh.rotation.x = Math.PI * 0.5;
+      mesh.rotation.y = Math.PI * 1.5;
+      this.add(mesh);
+      break;
+    case ROS3D.MARKER_MESH_RESOURCE:
+      // load and add the mesh
+      this.add(new ROS3D.MeshResource({
+        path : path,
+        resource : message.mesh_resource.substr(10)
+      }));
+      break;
+    case ROS3D.MARKER_TRIANGLE_LIST:
+      // create the list of triangles
+      var tri = new ROS3D.TriangleList({
+        material : colorMaterial,
+        vertices : message.points,
+        colors : message.colors
+      });
+      tri.scale = new THREE.Vector3(message.scale.x, message.scale.y, message.scale.z);
+      this.add(tri);
+      break;
+    default:
+      console.error('Currently unsupported marker type: ' + message.type);
+      break;
+  }
+};
+ROS3D.Marker.prototype.__proto__ = THREE.Object3D.prototype;
+
+/**
+ * Set the pose of this marker to the given values.
+ *
+ * @param pose - the pose to set for this marker
+ */
+ROS3D.Marker.prototype.setPose = function(pose) {
+  // set position information
+  this.position.x = pose.position.x;
+  this.position.y = pose.position.y;
+  this.position.z = pose.position.z;
+
+  // set the rotation
+  this.quaternion = new THREE.Quaternion(pose.orientation.x, pose.orientation.y,
+      pose.orientation.z, pose.orientation.w);
+  this.quaternion.normalize();
+
+  // update the world
+  this.updateMatrixWorld();
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/MarkerClient.js.html b/doc/MarkerClient.js.html new file mode 100644 index 00000000..40c00a81 --- /dev/null +++ b/doc/MarkerClient.js.html @@ -0,0 +1,104 @@ + + + + + JSDoc: Source: markers/MarkerClient.js + + + + + + + + + + +
+ +

Source: markers/MarkerClient.js

+ + + + + +
+
+
/**
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * A marker client that listens to a given marker topic.
+ *
+ * Emits the following events:
+ *  * 'change' - there was an update or change in the marker
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * ros - the ROSLIB.Ros connection handle
+ *   * topic - the marker topic to listen to
+ *   * tfClient - the TF client handle to use
+ *   * rootObject (optional) - the root object to add this marker to
+ */
+ROS3D.MarkerClient = function(options) {
+  var that = this;
+  options = options || {};
+  var ros = options.ros;
+  var topic = options.topic;
+  this.tfClient = options.tfClient;
+  this.rootObject = options.rootObject || new THREE.Object3D();
+
+  // current marker that is displayed
+  this.currentMarker = null;
+
+  // subscribe to the topic
+  var rosTopic = new ROSLIB.Topic({
+    ros : ros,
+    name : topic,
+    messageType : 'visualization_msgs/Marker',
+    compression : 'png'
+  });
+  rosTopic.subscribe(function(message) {
+    var newMarker = new ROS3D.Marker({
+      message : message
+    });
+    // check for an old marker
+    if (that.currentMarker) {
+      that.rootObject.remove(that.currentMarker);
+    }
+
+    that.currentMarker = new ROS3D.SceneNode({
+      frameID : message.header.frame_id,
+      tfClient : that.tfClient,
+      object : newMarker
+    });
+    that.rootObject.add(that.currentMarker);
+    
+    that.emit('change');
+  });
+};
+ROS3D.MarkerClient.prototype.__proto__ = EventEmitter2.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/MeshResource.js.html b/doc/MeshResource.js.html new file mode 100644 index 00000000..260b54bc --- /dev/null +++ b/doc/MeshResource.js.html @@ -0,0 +1,100 @@ + + + + + JSDoc: Source: models/MeshResource.js + + + + + + + + + + +
+ +

Source: models/MeshResource.js

+ + + + + +
+
+
/**
+ * @author Jihoon Lee - jihoonlee.in@gmail.com
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * A MeshResource is an THREE object that will load from a external mesh file. Currently loads
+ * Collada files.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * path (optional) - the base path to the associated models that will be loaded
+ *  * resource - the resource file name to load
+ *  * warnings (optional) - if warnings should be printed
+ */
+ROS3D.MeshResource = function(options) {
+  var that = this;
+  options = options || {};
+  var path = options.path || '/';
+  var resource = options.resource;
+  this.warnings = options.warnings;
+
+  THREE.Object3D.call(this);
+
+  // check for a trailing '/'
+  if (path.substr(path.length - 1) !== '/') {
+    this.path += '/';
+  }
+
+  var uri = path + resource;
+  var fileType = uri.substr(-4).toLowerCase();
+
+  // check the type
+  if (uri.substr(-4).toLowerCase() === '.dae') {
+    var loader = new ColladaLoader2();
+    loader.log = function(message) {
+      if (that.warnings) {
+        console.warn(message);
+      }
+    };
+    loader.load(uri, function colladaReady(collada) {
+      // check for a scale factor
+      if(collada.dae.asset.unit) {
+        var scale = collada.dae.asset.unit;
+        collada.scene.scale = new THREE.Vector3(scale, scale, scale);
+      }
+      that.add(collada.scene);
+    });
+  }
+};
+ROS3D.MeshResource.prototype.__proto__ = THREE.Object3D.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/MouseHandler.js.html b/doc/MouseHandler.js.html new file mode 100644 index 00000000..fd6bb45e --- /dev/null +++ b/doc/MouseHandler.js.html @@ -0,0 +1,207 @@ + + + + + JSDoc: Source: visualization/interaction/MouseHandler.js + + + + + + + + + + +
+ +

Source: visualization/interaction/MouseHandler.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * A handler for mouse events within a 3D viewer.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * renderer - the main renderer
+ *   * camera - the main camera in the scene
+ *   * rootObject - the root object to check for mouse events
+ *   * fallbackTarget - the fallback target, e.g., the camera controls
+ */
+ROS3D.MouseHandler = function(options) {
+  THREE.EventDispatcher.call(this);
+  this.renderer = options.renderer;
+  this.camera = options.camera;
+  this.rootObject = options.rootObject;
+  this.fallbackTarget = options.fallbackTarget;
+  this.lastTarget = this.fallbackTarget;
+  this.dragging = false;
+  this.projector = new THREE.Projector();
+
+  // listen to DOM events
+  var eventNames = [ 'contextmenu', 'click', 'dblclick', 'mouseout', 'mousedown', 'mouseup',
+      'mousemove', 'mousewheel', 'DOMMouseScroll', 'touchstart', 'touchend', 'touchcancel',
+      'touchleave', 'touchmove' ];
+  this.listeners = {};
+
+  // add event listeners for the associated mouse events
+  eventNames.forEach(function(eventName) {
+    this.listeners[eventName] = this.processDomEvent.bind(this);
+    this.renderer.domElement.addEventListener(eventName, this.listeners[eventName], false);
+  }, this);
+};
+
+/**
+ * Process the particular DOM even that has occurred based on the mouse's position in the scene.
+ *
+ * @param domEvent - the DOM event to process
+ */
+ROS3D.MouseHandler.prototype.processDomEvent = function(domEvent) {
+  // don't deal with the default handler
+  domEvent.preventDefault();
+
+  // compute normalized device coords and 3D mouse ray
+  var target = domEvent.target;
+  var rect = target.getBoundingClientRect();
+  var left = domEvent.clientX - rect.left - target.clientLeft + target.scrollLeft;
+  var top = domEvent.clientY - rect.top - target.clientTop + target.scrollTop;
+  var deviceX = left / target.clientWidth * 2 - 1;
+  var deviceY = -top / target.clientHeight * 2 + 1;
+  var vector = new THREE.Vector3(deviceX, deviceY, 0.5);
+  this.projector.unprojectVector(vector, this.camera);
+  // use the THREE raycaster
+  var mouseRaycaster = new THREE.Raycaster(this.camera.position.clone(), vector.sub(
+      this.camera.position).normalize());
+  var mouseRay = mouseRaycaster.ray;
+
+  // make our 3d mouse event
+  var event3D = {
+    mousePos : new THREE.Vector2(deviceX, deviceY),
+    mouseRay : mouseRay,
+    domEvent : domEvent,
+    camera : this.camera,
+    intersection : this.lastIntersection
+  };
+
+  // if the mouse leaves the dom element, stop everything
+  if (domEvent.type === 'mouseout') {
+    if (this.dragging) {
+      this.notify(this.lastTarget, 'mouseup', event3D);
+      this.dragging = false;
+    }
+    this.notify(this.lastTarget, 'mouseout', event3D);
+    this.lastTarget = null;
+    return;
+  }
+
+  // while the user is holding the mouse down, stay on the same target
+  if (this.dragging) {
+    this.notify(this.lastTarget, domEvent.type, event3D);
+    // for check for right or left mouse button
+    if ((domEvent.type === 'mouseup' && domEvent.button === 2) || domEvent.type === 'click') {
+      this.dragging = false;
+    }
+    return;
+  }
+
+  // in the normal case, we need to check what is under the mouse
+  target = this.lastTarget;
+  var intersections = [];
+  intersections = mouseRaycaster.intersectObject(this.rootObject, true);
+  if (intersections.length > 0) {
+    target = intersections[0].object;
+    event3D.intersection = this.lastIntersection = intersections[0];
+  } else {
+    target = this.fallbackTarget;
+  }
+
+  // if the mouse moves from one object to another (or from/to the 'null' object), notify both
+  if (target !== this.lastTarget) {
+    var eventAccepted = this.notify(target, 'mouseover', event3D);
+    if (eventAccepted) {
+      this.notify(this.lastTarget, 'mouseout', event3D);
+    } else {
+      // if target was null or no target has caught our event, fall back
+      target = this.fallbackTarget;
+      if (target !== this.lastTarget) {
+        this.notify(target, 'mouseover', event3D);
+        this.notify(this.lastTarget, 'mouseout', event3D);
+      }
+    }
+  }
+
+  // pass through event
+  this.notify(target, domEvent.type, event3D);
+  if (domEvent.type === 'mousedown') {
+    this.dragging = true;
+  }
+  this.lastTarget = target;
+};
+
+/**
+ * Notify the listener of the type of event that occurred.
+ *
+ * @param target - the target of the event
+ * @param type - the type of event that occurred
+ * @param event3D - the 3D mouse even information
+ * @returns if an event was canceled
+ */
+ROS3D.MouseHandler.prototype.notify = function(target, type, event3D) {
+  // ensure the type is set
+  event3D.type = type;
+
+  // make the event cancelable
+  event3D.cancelBubble = false;
+  event3D.stopPropagation = function() {
+    event3D.cancelBubble = true;
+  };
+  // walk up graph until event is canceled or root node has been reached
+  event3D.currentTarget = target;
+  while (event3D.currentTarget) {
+    // try to fire event on object
+    if (event3D.currentTarget.dispatchEvent
+        && event3D.currentTarget.dispatchEvent instanceof Function) {
+      event3D.currentTarget.dispatchEvent(event3D);
+      if (event3D.cancelBubble) {
+        this.dispatchEvent(event3D);
+        return true;
+      }
+    }
+    // walk up
+    event3D.currentTarget = event3D.currentTarget.parent;
+  }
+  return false;
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/OccupancyGrid.js.html b/doc/OccupancyGrid.js.html new file mode 100644 index 00000000..12c3a87e --- /dev/null +++ b/doc/OccupancyGrid.js.html @@ -0,0 +1,121 @@ + + + + + JSDoc: Source: maps/OccupancyGrid.js + + + + + + + + + + +
+ +

Source: maps/OccupancyGrid.js

+ + + + + +
+
+
/**
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * An OccupancyGrid can convert a ROS occupancy grid message into a THREE object.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * message - the occupancy grid message
+ */
+ROS3D.OccupancyGrid = function(options) {
+  options = options || {};
+  var message = options.message;
+
+  // create the geometry
+  var width = message.info.width;
+  var height = message.info.height;
+  var geom = new THREE.PlaneGeometry(width, height);
+
+  // internal drawing canvas
+  var canvas = document.createElement('canvas');
+  canvas.width = width;
+  canvas.height = height;
+  var context = canvas.getContext('2d');
+  // create the color material
+  var imageData = context.createImageData(width, height);
+  for ( var row = 0; row < height; row++) {
+    for ( var col = 0; col < width; col++) {
+      // determine the index into the map data
+      var mapI = col + ((height - row - 1) * width);
+      // determine the value
+      var data = message.data[mapI];
+      var val;
+      if (data === 100) {
+        val = 0;
+      } else if (data === 0) {
+        val = 255;
+      } else {
+        val = 127;
+      }
+
+      // determine the index into the image data array
+      var i = (col + (row * width)) * 4;
+      // r
+      imageData.data[i] = val;
+      // g
+      imageData.data[++i] = val;
+      // b
+      imageData.data[++i] = val;
+      // a
+      imageData.data[++i] = 255;
+    }
+  }
+  context.putImageData(imageData, 0, 0);
+
+  var texture = new THREE.Texture(canvas);
+  texture.needsUpdate = true;
+  var material = new THREE.MeshBasicMaterial({
+    map : texture
+  });
+  material.side = THREE.DoubleSide;
+
+  // create the mesh
+  THREE.Mesh.call(this, geom, material);
+  // move the map so the corner is at 0, 0
+  this.position.x = (width * message.info.resolution) / 2;
+  this.position.y = (height * message.info.resolution) / 2;
+  this.scale.x = message.info.resolution;
+  this.scale.y = message.info.resolution;
+};
+ROS3D.OccupancyGrid.prototype.__proto__ = THREE.Mesh.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/OccupancyGridClient.js.html b/doc/OccupancyGridClient.js.html new file mode 100644 index 00000000..6b956df1 --- /dev/null +++ b/doc/OccupancyGridClient.js.html @@ -0,0 +1,119 @@ + + + + + JSDoc: Source: maps/OccupancyGridClient.js + + + + + + + + + + +
+ +

Source: maps/OccupancyGridClient.js

+ + + + + +
+
+
/**
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * 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
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * ros - the ROSLIB.Ros connection handle
+ *   * topic (optional) - the map topic to listen to
+ *   * continuous (optional) - if the map should be continuously loaded (e.g., for SLAM)
+ *   * tfClient (optional) - the TF client handle to use for a scene node
+ *   * rootObject (optional) - the root object to add this marker to
+ */
+ROS3D.OccupancyGridClient = function(options) {
+  var that = this;
+  options = options || {};
+  var ros = options.ros;
+  var topic = options.topic || '/map';
+  this.continuous = options.continuous;
+  this.tfClient = options.tfClient;
+  this.rootObject = options.rootObject || new THREE.Object3D();
+
+  // current grid that is displayed
+  this.currentGrid = null;
+
+  // subscribe to the topic
+  var rosTopic = new ROSLIB.Topic({
+    ros : ros,
+    name : topic,
+    messageType : 'nav_msgs/OccupancyGrid',
+    compression : 'png'
+  });
+  rosTopic.subscribe(function(message) {
+    // check for an old map
+    if (that.currentGrid) {
+      that.rootObject.remove(that.currentGrid);
+    }
+
+    var newGrid = new ROS3D.OccupancyGrid({
+      message : message
+    });
+
+    // check if we care about the scene
+    if (that.tfClient) {
+      that.currentGrid = new ROS3D.SceneNode({
+        frameID : message.header.frame_id,
+        tfClient : that.tfClient,
+        object : newGrid,
+        pose : message.info.origin
+      });
+    } else {
+      that.currentGrid = newGrid;
+    }
+
+    that.rootObject.add(that.currentGrid);
+
+    that.emit('change');
+
+    // check if we should unsubscribe
+    if (!that.continuous) {
+      rosTopic.unsubscribe();
+    }
+  });
+};
+ROS3D.OccupancyGridClient.prototype.__proto__ = EventEmitter2.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/OrbitControls.js.html b/doc/OrbitControls.js.html new file mode 100644 index 00000000..e0353244 --- /dev/null +++ b/doc/OrbitControls.js.html @@ -0,0 +1,446 @@ + + + + + JSDoc: Source: visualization/interaction/OrbitControls.js + + + + + + + + + + +
+ +

Source: visualization/interaction/OrbitControls.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ * @author Xueqiao Xu - xueqiaoxu@gmail.com
+ * @author Mr.doob - http://mrdoob.com
+ * @author AlteredQualia - http://alteredqualia.com
+ */
+
+/**
+ * Behaves like THREE.OrbitControls, but uses right-handed coordinates and z as up vector.
+ *
+ * @constructor
+ * @param scene - the global scene to use
+ * @param camera - the camera to use
+ * @param userZoomSpeed (optional) - the speed for zooming
+ * @param userRotateSpeed (optional) - the speed for rotating
+ * @param autoRotate (optional) - if the orbit should auto rotate
+ * @param autoRotate (optional) - the speed for auto rotating
+ */
+ROS3D.OrbitControls = function(options) {
+  THREE.EventDispatcher.call(this);
+  var that = this;
+  options = options || {};
+  var scene = options.scene;
+  this.camera = options.camera;
+  this.center = new THREE.Vector3();
+  this.userZoom = true;
+  this.userZoomSpeed = options.userZoomSpeed || 1.0;
+  this.userRotate = true;
+  this.userRotateSpeed = options.userRotateSpeed || 1.0;
+  this.autoRotate = options.autoRotate;
+  this.autoRotateSpeed = options.autoRotateSpeed || 2.0;
+
+  // In ROS, z is pointing upwards
+  this.camera.up = new THREE.Vector3(0, 0, 1);
+
+  // internals
+  var pixlesPerRound = 1800;
+  var rotateStart = new THREE.Vector2();
+  var rotateEnd = new THREE.Vector2();
+  var rotateDelta = new THREE.Vector2();
+  var zoomStart = new THREE.Vector2();
+  var zoomEnd = new THREE.Vector2();
+  var zoomDelta = new THREE.Vector2();
+  var moveStartCenter = new THREE.Vector3();
+  var moveStartNormal = new THREE.Vector3();
+  var moveStartPosition = new THREE.Vector3();
+  var moveStartIntersection = new THREE.Vector3();
+  this.phiDelta = 0;
+  this.thetaDelta = 0;
+  this.scale = 1;
+  this.lastPosition = new THREE.Vector3();
+  // internal states
+  var STATE = {
+    NONE : -1,
+    ROTATE : 0,
+    ZOOM : 1,
+    MOVE : 2
+  };
+  var state = STATE.NONE;
+
+  // add the axes for the main coordinate frame
+  this.axes = new ROS3D.Axes({
+    shaftRadius : 0.025,
+    headRadius : 0.07,
+    headLength : 0.2
+  });
+  // initially not visible
+  scene.add(this.axes);
+  this.axes.traverse(function(obj) {
+    obj.visible = false;
+  });
+
+  /**
+   * Handle the mousedown 3D event.
+   *
+   * @param event3D - the 3D event to handle
+   */
+  function onMouseDown(event3D) {
+    var event = event3D.domEvent;
+    event.preventDefault();
+
+    switch (event.button) {
+      case 0:
+        state = STATE.ROTATE;
+        rotateStart.set(event.clientX, event.clientY);
+        break;
+      case 1:
+        state = STATE.MOVE;
+
+        moveStartNormal = new THREE.Vector3(0, 0, 1);
+        var rMat = new THREE.Matrix4().extractRotation(this.camera.matrix);
+        moveStartNormal.applyMatrix4(rMat);
+
+        moveStartCenter = that.center.clone();
+        moveStartPosition = that.camera.position.clone();
+        moveStartIntersection = intersectViewPlane(event3D.mouseRay, moveStartCenter,
+            moveStartNormal);
+        break;
+      case 2:
+        state = STATE.ZOOM;
+        zoomStart.set(event.clientX, event.clientY);
+        break;
+    }
+
+    this.showAxes();
+  }
+
+  /**
+   * Handle the movemove 3D event.
+   *
+   * @param event3D - the 3D event to handle
+   */
+  function onMouseMove(event3D) {
+    var event = event3D.domEvent;
+    if (state === STATE.ROTATE) {
+
+      rotateEnd.set(event.clientX, event.clientY);
+      rotateDelta.subVectors(rotateEnd, rotateStart);
+
+      that.rotateLeft(2 * Math.PI * rotateDelta.x / pixlesPerRound * that.userRotateSpeed);
+      that.rotateUp(2 * Math.PI * rotateDelta.y / pixlesPerRound * that.userRotateSpeed);
+
+      rotateStart.copy(rotateEnd);
+      this.showAxes();
+    } else if (state === STATE.ZOOM) {
+      zoomEnd.set(event.clientX, event.clientY);
+      zoomDelta.subVectors(zoomEnd, zoomStart);
+
+      if (zoomDelta.y > 0) {
+        that.zoomIn();
+      } else {
+        that.zoomOut();
+      }
+
+      zoomStart.copy(zoomEnd);
+      this.showAxes();
+
+    } else if (state === STATE.MOVE) {
+      var intersection = intersectViewPlane(event3D.mouseRay, that.center, moveStartNormal);
+
+      if (!intersection) {
+        return;
+      }
+
+      var delta = new THREE.Vector3().subVectors(moveStartIntersection.clone(), intersection
+          .clone());
+
+      that.center.addVectors(moveStartCenter.clone(), delta.clone());
+      that.camera.position.addVectors(moveStartPosition.clone(), delta.clone());
+      that.update();
+      that.camera.updateMatrixWorld();
+      this.showAxes();
+    }
+  }
+
+  /**
+   * Used to track the movement during camera movement.
+   *
+   * @param mouseRay - the mouse ray to intersect with
+   * @param planeOrigin - the origin of the plane
+   * @param planeNormal - the normal of the plane
+   * @returns the intersection
+   */
+  function intersectViewPlane(mouseRay, planeOrigin, planeNormal) {
+
+    var vector = new THREE.Vector3();
+    var intersection = new THREE.Vector3();
+
+    vector.subVectors(planeOrigin, mouseRay.origin);
+    var dot = mouseRay.direction.dot(planeNormal);
+
+    // bail if ray and plane are parallel
+    if (Math.abs(dot) < mouseRay.precision) {
+      return null;
+    }
+
+    // calc distance to plane
+    var scalar = planeNormal.dot(vector) / dot;
+
+    intersection = mouseRay.direction.clone().multiplyScalar(scalar);
+    return intersection;
+  }
+
+  /**
+   * Handle the mouseup 3D event.
+   *
+   * @param event3D - the 3D event to handle
+   */
+  function onMouseUp(event3D) {
+    if (!that.userRotate) {
+      return;
+    }
+
+    state = STATE.NONE;
+  }
+
+  /**
+   * Handle the mousewheel 3D event.
+   *
+   * @param event3D - the 3D event to handle
+   */
+  function onMouseWheel(event3D) {
+    if (!that.userZoom) {
+      return;
+    }
+
+    var event = event3D.domEvent;
+    // wheelDelta --> Chrome, detail --> Firefox
+    var delta;
+    if (typeof (event.wheelDelta) !== 'undefined') {
+      delta = event.wheelDelta;
+    } else {
+      delta = -event.detail;
+    }
+    if (delta > 0) {
+      that.zoomOut();
+    } else {
+      that.zoomIn();
+    }
+
+    this.showAxes();
+  }
+
+  /**
+   * Handle the touchdown 3D event.
+   *
+   * @param event3D - the 3D event to handle
+   */
+  function onTouchDown(event) {
+    onMouseDown(event);
+    event.preventDefault();
+  }
+
+  /**
+   * Handle the touchmove 3D event.
+   *
+   * @param event3D - the 3D event to handle
+   */
+  function onTouchMove(event) {
+    onMouseMove(event);
+    event.preventDefault();
+  }
+
+  // add event listeners
+  this.addEventListener('mousedown', onMouseDown);
+  this.addEventListener('mouseup', onMouseUp);
+  this.addEventListener('mousemove', onMouseMove);
+  this.addEventListener('touchstart', onTouchDown);
+  this.addEventListener('touchmove', onTouchMove);
+  // Chrome/Firefox have different events here
+  this.addEventListener('mousewheel', onMouseWheel);
+  this.addEventListener('DOMMouseScroll', onMouseWheel);
+};
+
+/**
+ * Display the main axes for 1 second.
+ */
+ROS3D.OrbitControls.prototype.showAxes = function() {
+  var that = this;
+
+  this.axes.traverse(function(obj) {
+    obj.visible = true;
+  });
+  if (this.hideTimeout) {
+    clearTimeout(this.hideTimeout);
+  }
+  this.hideTimeout = setTimeout(function() {
+    that.axes.traverse(function(obj) {
+      obj.visible = false;
+    });
+    that.hideTimeout = false;
+  }, 1000);
+};
+
+/**
+ * Rotate the camera to the left by the given angle.
+ *
+ * @param angle (optional) - the angle to rotate by
+ */
+ROS3D.OrbitControls.prototype.rotateLeft = function(angle) {
+  if (angle === undefined) {
+    angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
+  }
+  this.thetaDelta -= angle;
+};
+
+/**
+ * Rotate the camera to the right by the given angle.
+ *
+ * @param angle (optional) - the angle to rotate by
+ */
+ROS3D.OrbitControls.prototype.rotateRight = function(angle) {
+  if (angle === undefined) {
+    angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
+  }
+  this.thetaDelta += angle;
+};
+
+/**
+ * Rotate the camera up by the given angle.
+ *
+ * @param angle (optional) - the angle to rotate by
+ */
+ROS3D.OrbitControls.prototype.rotateUp = function(angle) {
+  if (angle === undefined) {
+    angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
+  }
+  this.phiDelta -= angle;
+};
+
+/**
+ * Rotate the camera down by the given angle.
+ *
+ * @param angle (optional) - the angle to rotate by
+ */
+ROS3D.OrbitControls.prototype.rotateDown = function(angle) {
+  if (angle === undefined) {
+    angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
+  }
+  this.phiDelta += angle;
+};
+
+/**
+ * Zoom in by the given scale.
+ *
+ * @param zoomScale (optional) - the scale to zoom in by
+ */
+ROS3D.OrbitControls.prototype.zoomIn = function(zoomScale) {
+  if (zoomScale === undefined) {
+    zoomScale = Math.pow(0.95, this.userZoomSpeed);
+  }
+  this.scale /= zoomScale;
+};
+
+/**
+ * Zoom out by the given scale.
+ *
+ * @param zoomScale (optional) - the scale to zoom in by
+ */
+ROS3D.OrbitControls.prototype.zoomOut = function(zoomScale) {
+  if (zoomScale === undefined) {
+    zoomScale = Math.pow(0.95, this.userZoomSpeed);
+  }
+  this.scale *= zoomScale;
+};
+
+/**
+ * Update the camera to the current settings.
+ */
+ROS3D.OrbitControls.prototype.update = function() {
+  // x->y, y->z, z->x
+  var position = this.camera.position;
+  var offset = position.clone().sub(this.center);
+
+  // angle from z-axis around y-axis
+  var theta = Math.atan2(offset.y, offset.x);
+
+  // angle from y-axis
+  var phi = Math.atan2(Math.sqrt(offset.y * offset.y + offset.x * offset.x), offset.z);
+
+  if (this.autoRotate) {
+    this.rotateLeft(2 * Math.PI / 60 / 60 * this.autoRotateSpeed);
+  }
+
+  theta += this.thetaDelta;
+  phi += this.phiDelta;
+
+  // restrict phi to be between EPS and PI-EPS
+  var eps = 0.000001;
+  phi = Math.max(eps, Math.min(Math.PI - eps, phi));
+
+  var radius = offset.length();
+  offset.y = radius * Math.sin(phi) * Math.sin(theta);
+  offset.z = radius * Math.cos(phi);
+  offset.x = radius * Math.sin(phi) * Math.cos(theta);
+  offset.multiplyScalar(this.scale);
+
+  position.copy(this.center).add(offset);
+
+  this.camera.lookAt(this.center);
+
+  radius = offset.length();
+  this.axes.position = this.center.clone();
+  this.axes.scale.x = this.axes.scale.y = this.axes.scale.z = radius * 0.05;
+  this.axes.updateMatrixWorld(true);
+
+  this.thetaDelta = 0;
+  this.phiDelta = 0;
+  this.scale = 1;
+
+  if (this.lastPosition.distanceTo(this.camera.position) > 0) {
+    this.dispatchEvent({
+      type : 'change'
+    });
+    this.lastPosition.copy(this.camera.position);
+  }
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.Arrow.html b/doc/ROS3D.Arrow.html new file mode 100644 index 00000000..7cd23f18 --- /dev/null +++ b/doc/ROS3D.Arrow.html @@ -0,0 +1,525 @@ + + + + + JSDoc: Class: Arrow + + + + + + + + + + +
+ +

Class: Arrow

+ + + + + +
+ +
+

+ ROS3D. + + Arrow +

+ +
+ +
+
+ + + + +
+

new Arrow(options)

+ + +
+
+ + +
+ A Arrow is a THREE object that can be used to display an arrow model. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * origin (optional) - the origin of the arrow + * direction (optional) - the direction vector of the arrow + * length (optional) - the length of the arrow + * headLength (optional) - the head length of the arrow + * shaftDiameter (optional) - the shaft diameter of the arrow + * headDiameter (optional) - the head diameter of the arrow + * material (optional) - the material to use for this arrow
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

setColor(hex)

+ + +
+
+ + +
+ Set the color of this arrow to the given hex value. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hex + + the hex value of the color to use
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

setDirection(direction)

+ + +
+
+ + +
+ Set the direction of this arrow to that of the given vector. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
direction + + the direction to set this arrow
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

setLength(length)

+ + +
+
+ + +
+ Set this arrow to be the given length. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + the new length of the arrow
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.Axes.html b/doc/ROS3D.Axes.html new file mode 100644 index 00000000..c416c341 --- /dev/null +++ b/doc/ROS3D.Axes.html @@ -0,0 +1,305 @@ + + + + + JSDoc: Class: Axes + + + + + + + + + + +
+ +

Class: Axes

+ + + + + +
+ +
+

+ ROS3D. + + Axes +

+ +
+ +
+
+ + + + +
+

new Axes(options)

+ + +
+
+ + +
+ An Axes object can be used to display the axis of a particular coordinate frame. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * shaftRadius (optional) - the radius of the shaft to render + * headRadius (optional) - the radius of the head to render + * headLength (optional) - the length of the head to render
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

<inner> addAxis(axis)

+ + +
+
+ + +
+ Adds an axis marker to this axes object. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
axis + + the 3D vector representing the axis to add
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.Grid.html b/doc/ROS3D.Grid.html new file mode 100644 index 00000000..db9504e0 --- /dev/null +++ b/doc/ROS3D.Grid.html @@ -0,0 +1,193 @@ + + + + + JSDoc: Class: Grid + + + + + + + + + + +
+ +

Class: Grid

+ + + + + +
+ +
+

+ ROS3D. + + Grid +

+ +
+ +
+
+ + + + +
+

new Grid(options)

+ + +
+
+ + +
+ Create a grid object. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * size (optional) - the size of the grid + * color (optional) - the line color of the grid, like '#cccccc' + * lineWidth (optional) - the width of the lines in the grid
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.Highlighter.html b/doc/ROS3D.Highlighter.html new file mode 100644 index 00000000..b24c10c4 --- /dev/null +++ b/doc/ROS3D.Highlighter.html @@ -0,0 +1,699 @@ + + + + + JSDoc: Class: Highlighter + + + + + + + + + + +
+ +

Class: Highlighter

+ + + + + +
+ +
+

+ ROS3D. + + Highlighter +

+ +
+ +
+
+ + + + +
+

new Highlighter(options)

+ + +
+
+ + +
+ A mouseover highlighter for 3D objects in the scene. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * mouseHandler - the handler for the mouseover and mouseout events
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

getWebglObjects(scene, objects, renderList)

+ + +
+
+ + +
+ Add all corresponding webgl objects in the given scene and add them to the given render list. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
scene + + the scene to check for webgl objects
objects + + the objects list to check
renderList + + the list to add to
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

onMouseOut(event)

+ + +
+
+ + +
+ Remove the current target of the mouseover from the hover list. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event that contains the target of the mouseout
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

onMouseOver(event)

+ + +
+
+ + +
+ Add the current target of the mouseover to the hover list. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event that contains the target of the mouseover
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

renderHighlight(renderer, scene, camera)

+ + +
+
+ + +
+ Render highlighted objects in the scene. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
renderer + + the renderer to use
scene + + the scene to use
camera + + the camera to use
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.InteractiveMarker.html b/doc/ROS3D.InteractiveMarker.html new file mode 100644 index 00000000..380a9313 --- /dev/null +++ b/doc/ROS3D.InteractiveMarker.html @@ -0,0 +1,1619 @@ + + + + + JSDoc: Class: InteractiveMarker + + + + + + + + + + +
+ +

Class: InteractiveMarker

+ + + + + +
+ +
+

+ ROS3D. + + InteractiveMarker +

+ +
+ +
+
+ + + + +
+

new InteractiveMarker(options)

+ + +
+
+ + +
+ The main interactive marker object. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * handle - the ROS3D.InteractiveMarkerHandle for this marker + * camera - the main camera associated with the viewer for this marker + * path (optional) - the base path to any meshes that will be loaded
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

buttonClick(control, event3d)

+ + +
+
+ + +
+ Handle a button click. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

feedbackEvent(type, control)

+ + +
+
+ + +
+ Dispatch the given event type. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + the type of event
control + + the control to use
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

moveAxis(control, origAxis, event3d)

+ + +
+
+ + +
+ Move the axis based on the given event information. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
origAxis + + the origin of the axis
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

movePlane(control, origNormal, event3d)

+ + +
+
+ + +
+ Move with respect to the plane based on the contorl and event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
origNormal + + the normal of the origin
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

onServerSetPose(event)

+ + +
+
+ + +
+ Update the marker based when the pose is set from the server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

rotateAxis(control, origOrientation, event3d)

+ + +
+
+ + +
+ Rotate based on the control and event given. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
origOrientation + + the orientation of the origin
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

setOrientation(control, event3d)

+ + +
+
+ + +
+ Handle a user pose change for the orientation. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

setPosition(control, event3d)

+ + +
+
+ + +
+ Handle a user pose change for the position. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

showMenu(control, event)

+ + +
+
+ + +
+ Show the interactive marker menu associated with this marker. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
event + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

startDrag(control, event3d)

+ + +
+
+ + +
+ Start a drag action. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

stopDrag(control, event3d)

+ + +
+
+ + +
+ Stop a drag action. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control to use
event3d + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.InteractiveMarkerClient.html b/doc/ROS3D.InteractiveMarkerClient.html new file mode 100644 index 00000000..813391bc --- /dev/null +++ b/doc/ROS3D.InteractiveMarkerClient.html @@ -0,0 +1,697 @@ + + + + + JSDoc: Class: InteractiveMarkerClient + + + + + + + + + + +
+ +

Class: InteractiveMarkerClient

+ + + + + +
+ +
+

+ ROS3D. + + InteractiveMarkerClient +

+ +
+ +
+
+ + + + +
+

new InteractiveMarkerClient(options)

+ + +
+
+ + +
+ A client for an interactive marker topic. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * ros - a handle to the ROS connection + * tfClient - a handle to the TF client + * topic (optional) - the topic to subscribe to, like '/basic_controls' + * path (optional) - the base path to any meshes that will be loaded + * camera - the main camera associated with the viewer for this marker client + * rootObject (optional) - the root THREE 3D object to render to
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

eraseIntMarker(intMarkerName)

+ + +
+
+ + +
+ Erase the interactive marker with the given name. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
intMarkerName + + the interactive marker name to delete
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

processInit(initMessage)

+ + +
+
+ + +
+ Process the given interactive marker initialization message. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
initMessage + + the interactive marker initialization message to process
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

processUpdate(initMessage)

+ + +
+
+ + +
+ Process the given interactive marker update message. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
initMessage + + the interactive marker update message to process
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

subscribe(topic)

+ + +
+
+ + +
+ Subscribe to the given interactive marker topic. This will unsubscribe from any current topics. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
topic + + the topic to subscribe to, like '/basic_controls'
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

unsubscribe()

+ + +
+
+ + +
+ Unsubscribe from the current interactive marker topic. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.InteractiveMarkerControl.html b/doc/ROS3D.InteractiveMarkerControl.html new file mode 100644 index 00000000..4d660fe9 --- /dev/null +++ b/doc/ROS3D.InteractiveMarkerControl.html @@ -0,0 +1,306 @@ + + + + + JSDoc: Class: InteractiveMarkerControl + + + + + + + + + + +
+ +

Class: InteractiveMarkerControl

+ + + + + +
+ +
+

+ ROS3D. + + InteractiveMarkerControl +

+ +
+ +
+
+ + + + +
+

new InteractiveMarkerControl(options)

+ + +
+
+ + +
+ The main marker control object for an interactive marker. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * parent - the parent of this control + * message - the interactive marker control message + * camera - the main camera associated with the viewer for this marker client + * path (optional) - the base path to any meshes that will be loaded
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

<inner> stopPropagation(event)

+ + +
+
+ + +
+ Install default listeners for highlighting / dragging. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event to stop
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.InteractiveMarkerHandle.html b/doc/ROS3D.InteractiveMarkerHandle.html new file mode 100644 index 00000000..f9353433 --- /dev/null +++ b/doc/ROS3D.InteractiveMarkerHandle.html @@ -0,0 +1,1248 @@ + + + + + JSDoc: Class: InteractiveMarkerHandle + + + + + + + + + + +
+ +

Class: InteractiveMarkerHandle

+ + + + + +
+ +
+

+ ROS3D. + + InteractiveMarkerHandle +

+ +
+ +
+
+ + + + +
+

new InteractiveMarkerHandle(options)

+ + +
+
+ + +
+ Handle with signals for a single interactive marker. + +Emits the following events: + * 'pose' - emitted when a new pose comes from the server +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * message - the interactive marker message + * feedbackTopic - the ROSLIB.Topic associated with the feedback + * tfClient - a handle to the TF client to use
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

emitServerPoseUpdate()

+ + +
+
+ + +
+ Emit the new pose that has come from the server. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

onButtonClick(event)

+ + +
+
+ + +
+ Send the button click feedback to the server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event associated with the button click
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

onMenuSelect(event)

+ + +
+
+ + +
+ Send the menu select feedback to the server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event associated with the menu select
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

onMouseDown(event)

+ + +
+
+ + +
+ Send the mousedown feedback to the server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event associated with the mousedown
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

onMouseUp(event)

+ + +
+
+ + +
+ Send the mouseup feedback to the server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event associated with the mouseup
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

sendFeedback(eventType, clickPosition, menuEntryID, controlName)

+ + +
+
+ + +
+ Send feedback to the interactive marker server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eventType + + the type of event that happened
clickPosition + + (optional) - the position in ROS space the click happened
menuEntryID + + (optional) - the menu entry ID that is associated
controlName + + the name of the control
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

setPoseFromClient(event)

+ + +
+
+ + +
+ Set the pose from the client based on the given event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + the event to base the change off of
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

setPoseFromServer(poseMsg)

+ + +
+
+ + +
+ Update the pose based on the pose given by the server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
poseMsg + + the pose given by the server
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

subscribeTf()

+ + +
+
+ + +
+ Subscribe to the TF associated with this interactive marker. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

tfUpdate(transformMsg)

+ + +
+
+ + +
+ Update the pose based on the TF given by the server. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transformMsg + + the TF given by the server
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.InteractiveMarkerMenu.html b/doc/ROS3D.InteractiveMarkerMenu.html new file mode 100644 index 00000000..08f79fe3 --- /dev/null +++ b/doc/ROS3D.InteractiveMarkerMenu.html @@ -0,0 +1,558 @@ + + + + + JSDoc: Class: InteractiveMarkerMenu + + + + + + + + + + +
+ +

Class: InteractiveMarkerMenu

+ + + + + +
+ +
+

+ ROS3D. + + InteractiveMarkerMenu +

+ +
+ +
+
+ + + + +
+

new InteractiveMarkerMenu(options)

+ + +
+
+ + +
+ A menu for an interactive marker. This will be overlayed on the canvas. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * menuEntries - the menu entries to add + * className (optional) - a custom CSS class for the menu div + * entryClassName (optional) - a custom CSS class for the menu entry + * overlayClassName (optional) - a custom CSS class for the menu overlay
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

hide(event)

+ + +
+
+ + +
+ Hide the menu DOM element. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + (optional) - the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

show(control, event)

+ + +
+
+ + +
+ Shoe the menu DOM element. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
control + + the control for the menu
event + + the event that caused this
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> makeUl(parentDomElem, parentMenu)

+ + +
+
+ + +
+ Create the HTML UL element for the menu and link it to the parent. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parentDomElem + + the parent DOM element
parentMenu + + the parent menu
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.Marker.html b/doc/ROS3D.Marker.html new file mode 100644 index 00000000..d9e8c9c3 --- /dev/null +++ b/doc/ROS3D.Marker.html @@ -0,0 +1,304 @@ + + + + + JSDoc: Class: Marker + + + + + + + + + + +
+ +

Class: Marker

+ + + + + +
+ +
+

+ ROS3D. + + Marker +

+ +
+ +
+
+ + + + +
+

new Marker(options)

+ + +
+
+ + +
+ A Marker can convert a ROS marker message into a THREE object. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * path - the base path or URL for any mesh files that will be loaded for this marker + * message - the marker message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

setPose(pose)

+ + +
+
+ + +
+ Set the pose of this marker to the given values. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pose + + the pose to set for this marker
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.MarkerClient.html b/doc/ROS3D.MarkerClient.html new file mode 100644 index 00000000..bed3499c --- /dev/null +++ b/doc/ROS3D.MarkerClient.html @@ -0,0 +1,197 @@ + + + + + JSDoc: Class: MarkerClient + + + + + + + + + + +
+ +

Class: MarkerClient

+ + + + + +
+ +
+

+ ROS3D. + + MarkerClient +

+ +
+ +
+
+ + + + +
+

new MarkerClient(options)

+ + +
+
+ + +
+ A marker client that listens to a given marker topic. + +Emits the following events: + * 'change' - there was an update or change in the marker +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * ros - the ROSLIB.Ros connection handle + * topic - the marker topic to listen to + * tfClient - the TF client handle to use + * rootObject (optional) - the root object to add this marker to
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.MeshResource.html b/doc/ROS3D.MeshResource.html new file mode 100644 index 00000000..005c740b --- /dev/null +++ b/doc/ROS3D.MeshResource.html @@ -0,0 +1,194 @@ + + + + + JSDoc: Class: MeshResource + + + + + + + + + + +
+ +

Class: MeshResource

+ + + + + +
+ +
+

+ ROS3D. + + MeshResource +

+ +
+ +
+
+ + + + +
+

new MeshResource(options)

+ + +
+
+ + +
+ A MeshResource is an THREE object that will load from a external mesh file. Currently loads +Collada files. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * path (optional) - the base path to the associated models that will be loaded + * resource - the resource file name to load + * warnings (optional) - if warnings should be printed
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.MouseHandler.html b/doc/ROS3D.MouseHandler.html new file mode 100644 index 00000000..cb334e6e --- /dev/null +++ b/doc/ROS3D.MouseHandler.html @@ -0,0 +1,460 @@ + + + + + JSDoc: Class: MouseHandler + + + + + + + + + + +
+ +

Class: MouseHandler

+ + + + + +
+ +
+

+ ROS3D. + + MouseHandler +

+ +
+ +
+
+ + + + +
+

new MouseHandler(options)

+ + +
+
+ + +
+ A handler for mouse events within a 3D viewer. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * renderer - the main renderer + * camera - the main camera in the scene + * rootObject - the root object to check for mouse events + * fallbackTarget - the fallback target, e.g., the camera controls
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

notify(target, type, event3D)

+ + +
+
+ + +
+ Notify the listener of the type of event that occurred. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + the target of the event
type + + the type of event that occurred
event3D + + the 3D mouse even information
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+ if an event was canceled +
+ + + + + + +
+ + + +
+

processDomEvent(domEvent)

+ + +
+
+ + +
+ Process the particular DOM even that has occurred based on the mouse's position in the scene. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
domEvent + + the DOM event to process
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.OccupancyGrid.html b/doc/ROS3D.OccupancyGrid.html new file mode 100644 index 00000000..69419bb8 --- /dev/null +++ b/doc/ROS3D.OccupancyGrid.html @@ -0,0 +1,191 @@ + + + + + JSDoc: Class: OccupancyGrid + + + + + + + + + + +
+ +

Class: OccupancyGrid

+ + + + + +
+ +
+

+ ROS3D. + + OccupancyGrid +

+ +
+ +
+
+ + + + +
+

new OccupancyGrid(options)

+ + +
+
+ + +
+ An OccupancyGrid can convert a ROS occupancy grid message into a THREE object. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * message - the occupancy grid message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.OccupancyGridClient.html b/doc/ROS3D.OccupancyGridClient.html new file mode 100644 index 00000000..1cf8f850 --- /dev/null +++ b/doc/ROS3D.OccupancyGridClient.html @@ -0,0 +1,198 @@ + + + + + JSDoc: Class: OccupancyGridClient + + + + + + + + + + +
+ +

Class: OccupancyGridClient

+ + + + + +
+ +
+

+ ROS3D. + + OccupancyGridClient +

+ +
+ +
+
+ + + + +
+

new OccupancyGridClient(options)

+ + +
+
+ + +
+ 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 +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * ros - the ROSLIB.Ros connection handle + * topic (optional) - the map topic to listen to + * continuous (optional) - if the map should be continuously loaded (e.g., for SLAM) + * tfClient (optional) - the TF client handle to use for a scene node + * rootObject (optional) - the root object to add this marker to
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.OrbitControls.html b/doc/ROS3D.OrbitControls.html new file mode 100644 index 00000000..c0017e72 --- /dev/null +++ b/doc/ROS3D.OrbitControls.html @@ -0,0 +1,1864 @@ + + + + + JSDoc: Class: OrbitControls + + + + + + + + + + +
+ +

Class: OrbitControls

+ + + + + +
+ +
+

+ ROS3D. + + OrbitControls +

+ +
+ +
+
+ + + + +
+

new OrbitControls(scene, camera, userZoomSpeed, userRotateSpeed, autoRotate, autoRotate)

+ + +
+
+ + +
+ Behaves like THREE.OrbitControls, but uses right-handed coordinates and z as up vector. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
scene + + the global scene to use
camera + + the camera to use
userZoomSpeed + + (optional) - the speed for zooming
userRotateSpeed + + (optional) - the speed for rotating
autoRotate + + (optional) - if the orbit should auto rotate
autoRotate + + (optional) - the speed for auto rotating
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

rotateDown(angle)

+ + +
+
+ + +
+ Rotate the camera down by the given angle. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
angle + + (optional) - the angle to rotate by
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

rotateLeft(angle)

+ + +
+
+ + +
+ Rotate the camera to the left by the given angle. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
angle + + (optional) - the angle to rotate by
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

rotateRight(angle)

+ + +
+
+ + +
+ Rotate the camera to the right by the given angle. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
angle + + (optional) - the angle to rotate by
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

rotateUp(angle)

+ + +
+
+ + +
+ Rotate the camera up by the given angle. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
angle + + (optional) - the angle to rotate by
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

showAxes()

+ + +
+
+ + +
+ Display the main axes for 1 second. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

update()

+ + +
+
+ + +
+ Update the camera to the current settings. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

zoomIn(zoomScale)

+ + +
+
+ + +
+ Zoom in by the given scale. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
zoomScale + + (optional) - the scale to zoom in by
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

zoomOut(zoomScale)

+ + +
+
+ + +
+ Zoom out by the given scale. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
zoomScale + + (optional) - the scale to zoom in by
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> intersectViewPlane(mouseRay, planeOrigin, planeNormal)

+ + +
+
+ + +
+ Used to track the movement during camera movement. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mouseRay + + the mouse ray to intersect with
planeOrigin + + the origin of the plane
planeNormal + + the normal of the plane
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
Returns:
+ + +
+ the intersection +
+ + + + + + +
+ + + +
+

<inner> onMouseDown(event3D)

+ + +
+
+ + +
+ Handle the mousedown 3D event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event3D + + the 3D event to handle
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> onMouseMove(event3D)

+ + +
+
+ + +
+ Handle the movemove 3D event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event3D + + the 3D event to handle
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> onMouseUp(event3D)

+ + +
+
+ + +
+ Handle the mouseup 3D event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event3D + + the 3D event to handle
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> onMouseWheel(event3D)

+ + +
+
+ + +
+ Handle the mousewheel 3D event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event3D + + the 3D event to handle
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> onTouchDown(event3D)

+ + +
+
+ + +
+ Handle the touchdown 3D event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event3D + + the 3D event to handle
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> onTouchMove(event3D)

+ + +
+
+ + +
+ Handle the touchmove 3D event. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event3D + + the 3D event to handle
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.SceneNode.html b/doc/ROS3D.SceneNode.html new file mode 100644 index 00000000..082a7397 --- /dev/null +++ b/doc/ROS3D.SceneNode.html @@ -0,0 +1,306 @@ + + + + + JSDoc: Class: SceneNode + + + + + + + + + + +
+ +

Class: SceneNode

+ + + + + +
+ +
+

+ ROS3D. + + SceneNode +

+ +
+ +
+
+ + + + +
+

new SceneNode(options)

+ + +
+
+ + +
+ A SceneNode can be used to keep track of a 3D object with respect to a ROS frame within a scene. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

updatePose(pose)

+ + +
+
+ + +
+ Set the pose of the associated model. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pose + + the pose to update with
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.TriangleList.html b/doc/ROS3D.TriangleList.html new file mode 100644 index 00000000..a1ee3aa1 --- /dev/null +++ b/doc/ROS3D.TriangleList.html @@ -0,0 +1,305 @@ + + + + + JSDoc: Class: TriangleList + + + + + + + + + + +
+ +

Class: TriangleList

+ + + + + +
+ +
+

+ ROS3D. + + TriangleList +

+ +
+ +
+
+ + + + +
+

new TriangleList(options)

+ + +
+
+ + +
+ A TriangleList is a THREE object that can be used to display a list of triangles as a geometry. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * material (optional) - the material to use for the object + * vertices - the array of vertices to use + * colors - the associated array of colors to use
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

setColor(hex)

+ + +
+
+ + +
+ Set the color of this object to the given hex value. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hex + + the hex value of the color to set
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.Urdf.html b/doc/ROS3D.Urdf.html new file mode 100644 index 00000000..60007cb9 --- /dev/null +++ b/doc/ROS3D.Urdf.html @@ -0,0 +1,193 @@ + + + + + JSDoc: Class: Urdf + + + + + + + + + + +
+ +

Class: Urdf

+ + + + + +
+ +
+

+ ROS3D. + + Urdf +

+ +
+ +
+
+ + + + +
+

new Urdf(options)

+ + +
+
+ + +
+ A URDF can be used to load a ROSLIB.UrdfModel and its associated models into a 3D object. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * urdfModel - the ROSLIB.UrdfModel to load + * tfClient - the TF client handle to use + * path (optional) - the base path to the associated Collada models that will be loaded
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.UrdfClient.html b/doc/ROS3D.UrdfClient.html new file mode 100644 index 00000000..2236d549 --- /dev/null +++ b/doc/ROS3D.UrdfClient.html @@ -0,0 +1,199 @@ + + + + + JSDoc: Class: UrdfClient + + + + + + + + + + +
+ +

Class: UrdfClient

+ + + + + +
+ +
+

+ ROS3D. + + UrdfClient +

+ +
+ +
+
+ + + + +
+

new UrdfClient(options)

+ + +
+
+ + +
+ A URDF client can be used to load a URDF and its associated models into a 3D object from the ROS +parameter server. + +Emits the following events: +* 'change' - emited after the URDF and its meshes have been loaded into the root object +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * ros - the ROSLIB.Ros connection handle + * param (optional) - the paramter to load the URDF from, like 'robot_description' + * tfClient - the TF client handle to use + * path (optional) - the base path to the associated Collada models that will be loaded + * rootObject (optional) - the root object to add this marker to
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/ROS3D.Viewer.html b/doc/ROS3D.Viewer.html new file mode 100644 index 00000000..d862fd91 --- /dev/null +++ b/doc/ROS3D.Viewer.html @@ -0,0 +1,392 @@ + + + + + JSDoc: Class: Viewer + + + + + + + + + + +
+ +

Class: Viewer

+ + + + + +
+ +
+

+ ROS3D. + + Viewer +

+ +
+ +
+
+ + + + +
+

new Viewer(options)

+ + +
+
+ + +
+ A Viewer can be used to render an interactive 3D scene to a HTML5 canvas. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + object with following keys: + * divID - the ID of the div to place the viewer in + * width - the initial width, in pixels, of the canvas + * height - the initial height, in pixels, of the canvas + * background (optional) - the color to render the background, like '#efefef' + * antialias (optional) - if antialiasing should be used + * intensity (optional) - the lighting intensity setting to use + * cameraPosition (optional) - the starting position of the camera
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+

addObject(object, selectable)

+ + +
+
+ + +
+ Add the given THREE Object3D to the global scene in the viewer. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
object + + the THREE Object3D to add
selectable + + (optional) - if the object should be added to the selectable list
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ + + +
+

<inner> draw()

+ + +
+
+ + +
+ Renders the associated scene to the that. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/Ros3D.js.html b/doc/Ros3D.js.html new file mode 100644 index 00000000..dfdab8c0 --- /dev/null +++ b/doc/Ros3D.js.html @@ -0,0 +1,218 @@ + + + + + JSDoc: Source: Ros3D.js + + + + + + + + + + +
+ +

Source: Ros3D.js

+ + + + + +
+
+
/**
+ * @author Russell Toris - rctoris@wpi.edu
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+var ROS3D = ROS3D || {
+  REVISION : '4'
+};
+
+// Marker types
+ROS3D.MARKER_ARROW = 0;
+ROS3D.MARKER_CUBE = 1;
+ROS3D.MARKER_SPHERE = 2;
+ROS3D.MARKER_CYLINDER = 3;
+ROS3D.MARKER_LINE_STRIP = 4;
+ROS3D.MARKER_LINE_LIST = 5;
+ROS3D.MARKER_CUBE_LIST = 6;
+ROS3D.MARKER_SPHERE_LIST = 7;
+ROS3D.MARKER_POINTS = 8;
+ROS3D.MARKER_TEXT_VIEW_FACING = 9;
+ROS3D.MARKER_MESH_RESOURCE = 10;
+ROS3D.MARKER_TRIANGLE_LIST = 11;
+
+// Interactive marker feedback types
+ROS3D.INTERACTIVE_MARKER_KEEP_ALIVE = 0;
+ROS3D.INTERACTIVE_MARKER_POSE_UPDATE = 1;
+ROS3D.INTERACTIVE_MARKER_MENU_SELECT = 2;
+ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK = 3;
+ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN = 4;
+ROS3D.INTERACTIVE_MARKER_MOUSE_UP = 5;
+
+// Interactive marker control types
+ROS3D.INTERACTIVE_MARKER_NONE = 0;
+ROS3D.INTERACTIVE_MARKER_MENU = 1;
+ROS3D.INTERACTIVE_MARKER_BUTTON = 2;
+ROS3D.INTERACTIVE_MARKER_MOVE_AXIS = 3;
+ROS3D.INTERACTIVE_MARKER_MOVE_PLANE = 4;
+ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS = 5;
+ROS3D.INTERACTIVE_MARKER_MOVE_ROTATE = 6;
+
+// Interactive marker rotation behavior
+ROS3D.INTERACTIVE_MARKER_INHERIT = 0;
+ROS3D.INTERACTIVE_MARKER_FIXED = 1;
+ROS3D.INTERACTIVE_MARKER_VIEW_FACING = 2;
+
+/**
+ * Create a THREE material based on the given RGBA values.
+ *
+ * @param r - the red value
+ * @param g - the green value
+ * @param b - the blue value
+ * @param a - the alpha value
+ * @returns the THREE material
+ */
+ROS3D.makeColorMaterial = function(r, g, b, a) {
+  var color = new THREE.Color();
+  color.setRGB(r, g, b);
+  if (a <= 0.99) {
+    return new THREE.MeshBasicMaterial({
+      color : color.getHex(),
+      opacity : a + 0.1,
+      transparent : true,
+      depthWrite : true,
+      blendSrc : THREE.SrcAlphaFactor,
+      blendDst : THREE.OneMinusSrcAlphaFactor,
+      blendEquation : THREE.ReverseSubtractEquation,
+      blending : THREE.NormalBlending
+    });
+  } else {
+    return new THREE.MeshLambertMaterial({
+      color : color.getHex(),
+      opacity : a,
+      blending : THREE.NormalBlending
+    });
+  }
+};
+
+/**
+ * Return the intersection between the mouseray and the plane.
+ *
+ * @param mouseRay - the mouse ray
+ * @param planeOrigin - the origin of the plane
+ * @param planeNormal - the normal of the plane
+ * @returns the intersection point
+ */
+ROS3D.intersectPlane = function(mouseRay, planeOrigin, planeNormal) {
+  var vector = new THREE.Vector3();
+  var intersectPoint = new THREE.Vector3();
+  vector.subVectors(planeOrigin, mouseRay.origin);
+  var dot = mouseRay.direction.dot(planeNormal);
+
+  // bail if ray and plane are parallel
+  if (Math.abs(dot) < mouseRay.precision) {
+    return undefined;
+  }
+
+  // calc distance to plane
+  var scalar = planeNormal.dot(vector) / dot;
+
+  intersectPoint.addVectors(mouseRay.origin, mouseRay.direction.clone().multiplyScalar(scalar));
+  return intersectPoint;
+};
+
+/**
+ * Find the closest point on targetRay to any point on mouseRay. Math taken from
+ * http://paulbourke.net/geometry/lineline3d/
+ *
+ * @param targetRay - the target ray to use
+ * @param mouseRay - the mouse ray
+ * @param the closest point between the two rays
+ */
+ROS3D.findClosestPoint = function(targetRay, mouseRay) {
+  var v13 = new THREE.Vector3();
+  v13.subVectors(targetRay.origin, mouseRay.origin);
+  var v43 = mouseRay.direction.clone();
+  var v21 = targetRay.direction.clone();
+  var d1343 = v13.dot(v43);
+  var d4321 = v43.dot(v21);
+  var d1321 = v13.dot(v21);
+  var d4343 = v43.dot(v43);
+  var d2121 = v21.dot(v21);
+
+  var denom = d2121 * d4343 - d4321 * d4321;
+  // check within a delta
+  if (Math.abs(denom) <= 0.0001) {
+    return undefined;
+  }
+  var numer = d1343 * d4321 - d1321 * d4343;
+
+  var mua = numer / denom;
+  return mua;
+};
+
+/**
+ * Find the closest point between the axis and the mouse.
+ *
+ * @param axisRay - the ray from the axis
+ * @param camera - the camera to project from
+ * @param mousePos - the mouse position
+ * @returns the closest axis point
+ */
+ROS3D.closestAxisPoint = function(axisRay, camera, mousePos) {
+  var projector = new THREE.Projector();
+
+  // project axis onto screen
+  var o = axisRay.origin.clone();
+  projector.projectVector(o, camera);
+  var o2 = axisRay.direction.clone().add(axisRay.origin);
+  projector.projectVector(o2, camera);
+
+  // d is the axis vector in screen space (d = o2-o)
+  var d = o2.clone().sub(o);
+
+  // t is the 2d ray param of perpendicular projection of mousePos onto o
+  var tmp = new THREE.Vector2();
+  // (t = (mousePos - o) * d / (d*d))
+  var t = tmp.subVectors(mousePos, o).dot(d) / d.dot(d);
+
+  // mp is the final 2d-projected mouse pos (mp = o + d*t)
+  var mp = new THREE.Vector2();
+  mp.addVectors(o, d.clone().multiplyScalar(t));
+
+  // go back to 3d by shooting a ray
+  var vector = new THREE.Vector3(mp.x, mp.y, 0.5);
+  projector.unprojectVector(vector, camera);
+  var mpRay = new THREE.Ray(camera.position, vector.sub(camera.position).normalize());
+
+  return ROS3D.findClosestPoint(axisRay, mpRay);
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:16 GMT-0700 (PDT) +
+ + + + diff --git a/doc/SceneNode.js.html b/doc/SceneNode.js.html new file mode 100644 index 00000000..ec30714b --- /dev/null +++ b/doc/SceneNode.js.html @@ -0,0 +1,108 @@ + + + + + JSDoc: Source: visualization/SceneNode.js + + + + + + + + + + +
+ +

Source: visualization/SceneNode.js

+ + + + + +
+
+
/**
+ * @author Jihoon Lee - jihoonlee.in@gmail.com
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * A SceneNode can be used to keep track of a 3D object with respect to a ROS frame within a scene.
+ *
+ * @constructor
+ * @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) {
+  options = options || {};
+  var that = this;
+  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;
+
+  // add the model
+  this.add(object);
+
+  // set the inital pose
+  this.updatePose(this.pose);
+
+  // listen for TF updates
+  tfClient.subscribe(frameID, function(msg) {
+
+    // apply the transform
+    var tf = new ROSLIB.Transform(msg);
+    var poseTransformed = new ROSLIB.Pose(that.pose);
+    poseTransformed.applyTransform(tf);
+
+    // update the world
+    that.updatePose(poseTransformed);
+  });
+};
+ROS3D.SceneNode.prototype.__proto__ = THREE.Object3D.prototype;
+
+/**
+ * Set the pose of the associated model.
+ *
+ * @param pose - the pose to update with
+ */
+ROS3D.SceneNode.prototype.updatePose = function(pose) {
+  this.position.x = pose.position.x;
+  this.position.y = pose.position.y;
+  this.position.z = pose.position.z;
+  this.quaternion = new THREE.Quaternion(pose.orientation.x, pose.orientation.y,
+      pose.orientation.z, pose.orientation.w);
+  this.updateMatrixWorld(true);
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/TriangleList.js.html b/doc/TriangleList.js.html new file mode 100644 index 00000000..5fd10ed1 --- /dev/null +++ b/doc/TriangleList.js.html @@ -0,0 +1,126 @@ + + + + + JSDoc: Source: models/TriangleList.js + + + + + + + + + + +
+ +

Source: models/TriangleList.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ */
+
+/**
+ * A TriangleList is a THREE object that can be used to display a list of triangles as a geometry.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * material (optional) - the material to use for the object
+ *   * vertices - the array of vertices to use
+ *   * colors - the associated array of colors to use
+ */
+ROS3D.TriangleList = function(options) {
+  options = options || {};
+  var material = options.material || new THREE.MeshBasicMaterial();
+  var vertices = options.vertices;
+  var colors = options.colors;
+
+  THREE.Object3D.call(this);
+
+  // set the material to be double sided
+  material.side = THREE.DoubleSide;
+
+  // construct the geometry
+  var geometry = new THREE.Geometry();
+  for (i = 0; i < vertices.length; i++) {
+    geometry.vertices.push(new THREE.Vector3(vertices[i].x, vertices[i].y, vertices[i].z));
+  }
+
+  // set the colors
+  var i, j;
+  if (colors.length === vertices.length) {
+    // use per-vertex color
+    for (i = 0; i < vertices.length; i += 3) {
+      var faceVert = new THREE.Face3(i, i + 1, i + 2);
+      for (j = i * 3; j < i * 3 + 3; i++) {
+        var color = new THREE.Color();
+        color.setRGB(colors[i].r, colors[i].g, colors[i].b);
+        faceVert.vertexColors.push(color);
+      }
+      geometry.faces.push(face);
+    }
+    material.vertexColors = THREE.VertexColors;
+  } else if (colors.length === vertices.length / 3) {
+    // use per-triangle color
+    for (i = 0; i < vertices.length; i += 3) {
+      var faceTri = new THREE.Face3(i, i + 1, i + 2);
+      faceTri.color.setRGB(colors[i / 3].r, colors[i / 3].g, colors[i / 3].b);
+      geometry.faces.push(faceTri);
+    }
+    material.vertexColors = THREE.FaceColors;
+  } else {
+    // use marker color
+    for (i = 0; i < vertices.length; i += 3) {
+      var face = new THREE.Face3(i, i + 1, i + 2);
+      geometry.faces.push(face);
+    }
+  }
+
+  geometry.computeBoundingBox();
+  geometry.computeBoundingSphere();
+  geometry.computeCentroids();
+  geometry.computeFaceNormals();
+
+  this.add(new THREE.Mesh(geometry, material));
+};
+ROS3D.TriangleList.prototype.__proto__ = THREE.Object3D.prototype;
+
+/**
+ * Set the color of this object to the given hex value.
+ *
+ * @param hex - the hex value of the color to set
+ */
+ROS3D.TriangleList.prototype.setColor = function(hex) {
+  this.mesh.material.color.setHex(hex);
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/Urdf.js.html b/doc/Urdf.js.html new file mode 100644 index 00000000..19a1d720 --- /dev/null +++ b/doc/Urdf.js.html @@ -0,0 +1,101 @@ + + + + + JSDoc: Source: urdf/Urdf.js + + + + + + + + + + +
+ +

Source: urdf/Urdf.js

+ + + + + +
+
+
/**
+ * @author Jihoon Lee - jihoonlee.in@gmail.com
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * A URDF can be used to load a ROSLIB.UrdfModel and its associated models into a 3D object.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * urdfModel - the ROSLIB.UrdfModel to load
+ *   * tfClient - the TF client handle to use
+ *   * path (optional) - the base path to the associated Collada models that will be loaded
+ */
+ROS3D.Urdf = function(options) {
+  options = options || {};
+  var urdfModel = options.urdfModel;
+  var path = options.path || '/';
+  var tfClient = options.tfClient;
+
+  THREE.Object3D.call(this);
+  this.useQuaternion = true;
+
+  // load all models
+  var links = urdfModel.links;
+  for ( var l in links) {
+    var link = links[l];
+    if (link.visual && link.visual.geometry) {
+      if (link.visual.geometry.type === ROSLIB.URDF_MESH) {
+        var frameID = '/' + link.name;
+        var uri = link.visual.geometry.filename;
+        var fileType = uri.substr(-4).toLowerCase();
+
+        // ignore mesh files which are not in Collada format
+        if (fileType === '.dae') {
+          // 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,
+              resource : uri.substring(10)
+            })
+          });
+          this.add(sceneNode);
+        }
+      }
+    }
+  }
+};
+ROS3D.Urdf.prototype.__proto__ = THREE.Object3D.prototype;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/UrdfClient.js.html b/doc/UrdfClient.js.html new file mode 100644 index 00000000..e4dfb0dc --- /dev/null +++ b/doc/UrdfClient.js.html @@ -0,0 +1,97 @@ + + + + + JSDoc: Source: urdf/UrdfClient.js + + + + + + + + + + +
+ +

Source: urdf/UrdfClient.js

+ + + + + +
+
+
/**
+ * @author Jihoon Lee - jihoonlee.in@gmail.com
+ * @author Russell Toris - rctoris@wpi.edu
+ */
+
+/**
+ * A URDF client can be used to load a URDF and its associated models into a 3D object from the ROS
+ * parameter server.
+ *
+ * Emits the following events:
+ * * 'change' - emited after the URDF and its meshes have been loaded into the root object
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *   * ros - the ROSLIB.Ros connection handle
+ *   * param (optional) - the paramter to load the URDF from, like 'robot_description'
+ *   * tfClient - the TF client handle to use
+ *   * path (optional) - the base path to the associated Collada models that will be loaded
+ *   * rootObject (optional) - the root object to add this marker to
+ */
+ROS3D.UrdfClient = function(options) {
+  var that = this;
+  options = options || {};
+  var ros = options.ros;
+  var param = options.param || 'robot_description';
+  this.path = options.path || '/';
+  this.tfClient = options.tfClient;
+  this.rootObject = options.rootObject || new THREE.Object3D();
+
+  // get the URDF value from ROS
+  var getParam = new ROSLIB.Param({
+    ros : ros,
+    name : param
+  });
+  getParam.get(function(string) {
+    // hand off the XML string to the URDF model
+    var urdfModel = new ROSLIB.UrdfModel({
+      string : string
+    });
+
+    // load all models
+    that.rootObject.add(new ROS3D.Urdf({
+      urdfModel : urdfModel,
+      path : that.path,
+      tfClient : that.tfClient
+    }));
+  });
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/Viewer.js.html b/doc/Viewer.js.html new file mode 100644 index 00000000..1584d42b --- /dev/null +++ b/doc/Viewer.js.html @@ -0,0 +1,170 @@ + + + + + JSDoc: Source: visualization/Viewer.js + + + + + + + + + + +
+ +

Source: visualization/Viewer.js

+ + + + + +
+
+
/**
+ * @author David Gossow - dgossow@willowgarage.com
+ * @author Russell Toris - rctoris@wpi.edu
+ * @author Jihoon Lee - jihoonlee.in@gmail.com
+ */
+
+/**
+ * A Viewer can be used to render an interactive 3D scene to a HTML5 canvas.
+ *
+ * @constructor
+ * @param options - object with following keys:
+ *  * divID - the ID of the div to place the viewer in
+ *  * width - the initial width, in pixels, of the canvas
+ *  * height - the initial height, in pixels, of the canvas
+ *  * background (optional) - the color to render the background, like '#efefef'
+ *  * antialias (optional) - if antialiasing should be used
+ *  * intensity (optional) - the lighting intensity setting to use
+ *  * cameraPosition (optional) - the starting position of the camera
+ */
+ROS3D.Viewer = function(options) {
+  var that = this;
+  options = options || {};
+  var divID = options.divID;
+  var width = options.width;
+  var height = options.height;
+  var background = options.background || '#111111';
+  var antialias = options.antialias;
+  var intensity = options.intensity || 0.66;
+  var cameraPosition = options.cameraPose || {
+    x : 3,
+    y : 3,
+    z : 3
+  };
+
+  // create the canvas to render to
+  this.renderer = new THREE.WebGLRenderer({
+    antialias : this.antialias
+  });
+  this.renderer.setClearColorHex(background.replace('#', '0x'), 1.0);
+  this.renderer.sortObjects = false;
+  this.renderer.setSize(width, height);
+  this.renderer.shadowMapEnabled = false;
+  this.renderer.autoClear = false;
+
+  // create the global scene
+  this.scene = new THREE.Scene();
+
+  // create the global camera
+  this.camera = new THREE.PerspectiveCamera(40, width / height, 0.01, 1000);
+  this.camera.position.x = cameraPosition.x;
+  this.camera.position.y = cameraPosition.y;
+  this.camera.position.z = cameraPosition.z;
+  // add controls to the camera
+  this.cameraControls = new ROS3D.OrbitControls({
+    scene : this.scene,
+    camera : this.camera
+  });
+  this.cameraControls.userZoomSpeed = 0.5;
+
+  // lights
+  this.scene.add(new THREE.AmbientLight(0x555555));
+  this.directionalLight = new THREE.DirectionalLight(0xffffff, intensity);
+  this.scene.add(this.directionalLight);
+
+  // propagates mouse events to three.js objects
+  this.selectableObjects = new THREE.Object3D();
+  this.scene.add(this.selectableObjects);
+  var mouseHandler = new ROS3D.MouseHandler({
+    renderer : this.renderer,
+    camera : this.camera,
+    rootObject : this.selectableObjects,
+    fallbackTarget : this.cameraControls
+  });
+
+  // highlights the receiver of mouse events
+  this.highlighter = new ROS3D.Highlighter({
+    mouseHandler : mouseHandler
+  });
+
+  /**
+   * Renders the associated scene to the that.
+   */
+  function draw() {
+    // update the controls
+    that.cameraControls.update();
+
+    // put light to the top-left of the camera
+    that.directionalLight.position = that.camera.localToWorld(new THREE.Vector3(-1, 1, 0));
+    that.directionalLight.position.normalize();
+
+    // set the scene
+    that.renderer.clear(true, true, true);
+    that.renderer.render(that.scene, that.camera);
+
+    // render any mouseovers
+    that.highlighter.renderHighlight(that.renderer, that.scene, that.camera);
+
+    // draw the frame
+    requestAnimationFrame(draw);
+  }
+
+  // add the renderer to the page
+  document.getElementById(divID).appendChild(this.renderer.domElement);
+
+  // begin the animation
+  draw();
+};
+
+/**
+ * Add the given THREE Object3D to the global scene in the viewer.
+ *
+ * @param object - the THREE Object3D to add
+ * @param selectable (optional) - if the object should be added to the selectable list
+ */
+ROS3D.Viewer.prototype.addObject = function(object, selectable) {
+  if (selectable) {
+    this.selectableObjects.add(object);
+  } else {
+    this.scene.add(object);
+  }
+};
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/global.html b/doc/global.html new file mode 100644 index 00000000..ce282e0e --- /dev/null +++ b/doc/global.html @@ -0,0 +1,175 @@ + + + + + JSDoc: Global + + + + + + + + + + +
+ +

Global

+ + + + + +
+ +
+

+ +

+ +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+

ROS3D

+ + +
+
+ + + +
+ + + + + + + + + + + +
Author:
+
+
    +
  • Russell Toris - rctoris@wpi.edu
  • + +
  • David Gossow - dgossow@willowgarage.com
  • +
+
+ + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ +
+ + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/index.html b/doc/index.html index d6e3b6f2..0d68dc73 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,378 +1,62 @@ - - - - - - JsDoc Reference - Index - - - - - - - - - - -
-

Class Index

- - -
-

_global_

- -
-
- -
-

ROS3D.Arrow

- -
-
- -
-

ROS3D.Axes

- -
-
- -
-

ROS3D.Grid

- -
-
- - -
- - -
- - -
- - -
- - -
- - -
- -
-

ROS3D.Marker

- -
-
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- -
-

ROS3D.Urdf

- -
-
- - -
- -
-

ROS3D.Viewer

- -
-
- - -
-
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - \ No newline at end of file + + + +
+ +
+ Documentation generated by JSDoc 3.2.0-dev on Mon Apr 15 2013 09:10:17 GMT-0700 (PDT) +
+ + + + diff --git a/doc/scripts/prettify/Apache-License-2.0.txt b/doc/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/doc/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/doc/scripts/prettify/lang-css.js b/doc/scripts/prettify/lang-css.js new file mode 100644 index 00000000..041e1f59 --- /dev/null +++ b/doc/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/doc/scripts/prettify/prettify.js b/doc/scripts/prettify/prettify.js new file mode 100644 index 00000000..eef5ad7e --- /dev/null +++ b/doc/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p Date: Mon, 15 Apr 2013 09:14:01 -0700 Subject: [PATCH 4/7] old doc removed --- CHANGELOG.md | 2 +- doc/files.html | 510 --------- doc/symbols/ROS3D.Arrow.html | 517 --------- doc/symbols/ROS3D.Axes.html | 423 ------- doc/symbols/ROS3D.Grid.html | 355 ------ doc/symbols/ROS3D.Highlighter.html | 580 ---------- doc/symbols/ROS3D.InteractiveMarker.html | 951 ---------------- .../ROS3D.InteractiveMarkerClient.html | 595 ---------- .../ROS3D.InteractiveMarkerControl.html | 469 -------- .../ROS3D.InteractiveMarkerHandle.html | 827 -------------- doc/symbols/ROS3D.InteractiveMarkerMenu.html | 526 --------- doc/symbols/ROS3D.Marker.html | 422 ------- doc/symbols/ROS3D.MarkerClient.html | 359 ------ doc/symbols/ROS3D.MeshResource.html | 356 ------ doc/symbols/ROS3D.MouseHandler.html | 522 --------- doc/symbols/ROS3D.OccupancyGrid.html | 353 ------ doc/symbols/ROS3D.OccupancyGridClient.html | 359 ------ doc/symbols/ROS3D.OrbitControls.html | 1013 ----------------- doc/symbols/ROS3D.SceneNode.html | 356 ------ doc/symbols/ROS3D.TriangleList.html | 423 ------- doc/symbols/ROS3D.Urdf.html | 355 ------ doc/symbols/ROS3D.UrdfClient.html | 362 ------ doc/symbols/ROS3D.Viewer.html | 466 -------- doc/symbols/_global_.html | 349 ------ ...L_ROS_groovy_src_ros3djs_src_Ros3D.js.html | 177 --- ...teractivemarkers_InteractiveMarker.js.html | 309 ----- ...ivemarkers_InteractiveMarkerClient.js.html | 189 --- ...vemarkers_InteractiveMarkerControl.js.html | 189 --- ...ivemarkers_InteractiveMarkerHandle.js.html | 180 --- ...ctivemarkers_InteractiveMarkerMenu.js.html | 175 --- ...src_ros3djs_src_maps_OccupancyGrid.js.html | 67 -- ...s3djs_src_maps_OccupancyGridClient.js.html | 63 - ...ovy_src_ros3djs_src_markers_Marker.js.html | 197 ---- ...c_ros3djs_src_markers_MarkerClient.js.html | 63 - ...roovy_src_ros3djs_src_models_Arrow.js.html | 89 -- ...groovy_src_ros3djs_src_models_Axes.js.html | 78 -- ...groovy_src_ros3djs_src_models_Grid.js.html | 37 - ...rc_ros3djs_src_models_MeshResource.js.html | 54 - ...rc_ros3djs_src_models_TriangleList.js.html | 84 -- ...S_groovy_src_ros3djs_src_urdf_Urdf.js.html | 60 - ...vy_src_ros3djs_src_urdf_UrdfClient.js.html | 56 - ...os3djs_src_visualization_SceneNode.js.html | 55 - ...c_ros3djs_src_visualization_Viewer.js.html | 123 -- ...ualization_interaction_Highlighter.js.html | 101 -- ...alization_interaction_MouseHandler.js.html | 175 --- ...lization_interaction_OrbitControls.js.html | 377 ------ 46 files changed, 1 insertion(+), 14347 deletions(-) delete mode 100644 doc/files.html delete mode 100644 doc/symbols/ROS3D.Arrow.html delete mode 100644 doc/symbols/ROS3D.Axes.html delete mode 100644 doc/symbols/ROS3D.Grid.html delete mode 100644 doc/symbols/ROS3D.Highlighter.html delete mode 100644 doc/symbols/ROS3D.InteractiveMarker.html delete mode 100644 doc/symbols/ROS3D.InteractiveMarkerClient.html delete mode 100644 doc/symbols/ROS3D.InteractiveMarkerControl.html delete mode 100644 doc/symbols/ROS3D.InteractiveMarkerHandle.html delete mode 100644 doc/symbols/ROS3D.InteractiveMarkerMenu.html delete mode 100644 doc/symbols/ROS3D.Marker.html delete mode 100644 doc/symbols/ROS3D.MarkerClient.html delete mode 100644 doc/symbols/ROS3D.MeshResource.html delete mode 100644 doc/symbols/ROS3D.MouseHandler.html delete mode 100644 doc/symbols/ROS3D.OccupancyGrid.html delete mode 100644 doc/symbols/ROS3D.OccupancyGridClient.html delete mode 100644 doc/symbols/ROS3D.OrbitControls.html delete mode 100644 doc/symbols/ROS3D.SceneNode.html delete mode 100644 doc/symbols/ROS3D.TriangleList.html delete mode 100644 doc/symbols/ROS3D.Urdf.html delete mode 100644 doc/symbols/ROS3D.UrdfClient.html delete mode 100644 doc/symbols/ROS3D.Viewer.html delete mode 100644 doc/symbols/_global_.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_Ros3D.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarker.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerClient.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerControl.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerHandle.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerMenu.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGrid.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGridClient.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_Marker.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_MarkerClient.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Arrow.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Axes.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Grid.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_MeshResource.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_TriangleList.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_Urdf.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_UrdfClient.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_SceneNode.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_Viewer.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_Highlighter.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_MouseHandler.js.html delete mode 100644 doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_OrbitControls.js.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 2880b2ef..bd06935f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -DEVEL - **r4** +2013-04-15 - **r4** * Initial pose now set in SceneNode [(rctoris)](https://github.com/rctoris/) * Texture method for OccupancyGrid changed to canvas to allow for very large maps [(rctoris)](https://github.com/rctoris/) * OccupancyGrid origin now in corner instead of center of image [(rctoris)](https://github.com/rctoris/) diff --git a/doc/files.html b/doc/files.html deleted file mode 100644 index b9e6f716..00000000 --- a/doc/files.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - - JsDoc Reference - File Index - - - - - - - - - - -
-

File Index

- - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
-
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - \ No newline at end of file diff --git a/doc/symbols/ROS3D.Arrow.html b/doc/symbols/ROS3D.Arrow.html deleted file mode 100644 index 3f2da7fa..00000000 --- a/doc/symbols/ROS3D.Arrow.html +++ /dev/null @@ -1,517 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.Arrow - - - - - - - - - - - - - -
- -

- - Class ROS3D.Arrow -

- - -

- - - - - - -
Defined in: Arrow.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.Arrow(options) -
-
A Arrow is a THREE object that can be used to display an arrow model.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
setColor(hex) -
-
Set the color of this arrow to the given hex value.
-
  -
setDirection(direction) -
-
Set the direction of this arrow to that of the given vector.
-
  -
setLength(length) -
-
Set this arrow to be the given length.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.Arrow(options) -
- -
- A Arrow is a THREE object that can be used to display an arrow model. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * origin (optional) - the origin of the arrow - * direction (optional) - the direction vector of the arrow - * length (optional) - the length of the arrow - * headLength (optional) - the head length of the arrow - * shaftDiameter (optional) - the shaft diameter of the arrow - * headDiameter (optional) - the head diameter of the arrow - * material (optional) - the material to use for this arrow
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - setColor(hex) - -
-
- Set the color of this arrow to the given hex value. - - -
- - - - -
-
Parameters:
- -
- hex - -
-
- the hex value of the color to use
- -
- - - - - - - - -
- - -
- - - setDirection(direction) - -
-
- Set the direction of this arrow to that of the given vector. - - -
- - - - -
-
Parameters:
- -
- direction - -
-
- the direction to set this arrow
- -
- - - - - - - - -
- - -
- - - setLength(length) - -
-
- Set this arrow to be the given length. - - -
- - - - -
-
Parameters:
- -
- length - -
-
- the new length of the arrow
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.Axes.html b/doc/symbols/ROS3D.Axes.html deleted file mode 100644 index 0c670b6d..00000000 --- a/doc/symbols/ROS3D.Axes.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.Axes - - - - - - - - - - - - - -
- -

- - Class ROS3D.Axes -

- - -

- - - - - - -
Defined in: Axes.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.Axes(options) -
-
An Axes object can be used to display the axis of a particular coordinate frame.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
<inner>   -
addAxis(axis) -
-
Adds an axis marker to this axes object.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.Axes(options) -
- -
- An Axes object can be used to display the axis of a particular coordinate frame. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * shaftRadius (optional) - the radius of the shaft to render - * headRadius (optional) - the radius of the head to render - * headLength (optional) - the length of the head to render
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
<inner> - - - addAxis(axis) - -
-
- Adds an axis marker to this axes object. - - -
- - - - -
-
Parameters:
- -
- axis - -
-
- the 3D vector representing the axis to add
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.Grid.html b/doc/symbols/ROS3D.Grid.html deleted file mode 100644 index fed1bc56..00000000 --- a/doc/symbols/ROS3D.Grid.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.Grid - - - - - - - - - - - - - -
- -

- - Class ROS3D.Grid -

- - -

- - - - - - -
Defined in: Grid.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.Grid(options) -
-
Create a grid object.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.Grid(options) -
- -
- Create a grid object. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * size (optional) - the size of the grid - * color (optional) - the line color of the grid, like '#cccccc' - * lineWidth (optional) - the width of the lines in the grid
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.Highlighter.html b/doc/symbols/ROS3D.Highlighter.html deleted file mode 100644 index 7b49a1c3..00000000 --- a/doc/symbols/ROS3D.Highlighter.html +++ /dev/null @@ -1,580 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.Highlighter - - - - - - - - - - - - - -
- -

- - Class ROS3D.Highlighter -

- - -

- - - - - - -
Defined in: Highlighter.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.Highlighter(options) -
-
A mouseover highlighter for 3D objects in the scene.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
getWebglObjects(scene, objects, renderList) -
-
Add all corresponding webgl objects in the given scene and add them to the given render list.
-
  -
onMouseOut(event) -
-
Remove the current target of the mouseover from the hover list.
-
  -
onMouseOver(event) -
-
Add the current target of the mouseover to the hover list.
-
  -
renderHighlight(renderer, scene, camera) -
-
Render highlighted objects in the scene.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.Highlighter(options) -
- -
- A mouseover highlighter for 3D objects in the scene. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * mouseHandler - the handler for the mouseover and mouseout events
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - getWebglObjects(scene, objects, renderList) - -
-
- Add all corresponding webgl objects in the given scene and add them to the given render list. - - -
- - - - -
-
Parameters:
- -
- scene - -
-
- the scene to check for webgl objects
- -
- objects - -
-
- the objects list to check
- -
- renderList - -
-
- the list to add to
- -
- - - - - - - - -
- - -
- - - onMouseOut(event) - -
-
- Remove the current target of the mouseover from the hover list. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event that contains the target of the mouseout
- -
- - - - - - - - -
- - -
- - - onMouseOver(event) - -
-
- Add the current target of the mouseover to the hover list. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event that contains the target of the mouseover
- -
- - - - - - - - -
- - -
- - - renderHighlight(renderer, scene, camera) - -
-
- Render highlighted objects in the scene. - - -
- - - - -
-
Parameters:
- -
- renderer - -
-
- the renderer to use
- -
- scene - -
-
- the scene to use
- -
- camera - -
-
- the camera to use
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.InteractiveMarker.html b/doc/symbols/ROS3D.InteractiveMarker.html deleted file mode 100644 index cb599128..00000000 --- a/doc/symbols/ROS3D.InteractiveMarker.html +++ /dev/null @@ -1,951 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.InteractiveMarker - - - - - - - - - - - - - -
- -

- - Class ROS3D.InteractiveMarker -

- - -

- - - - - - -
Defined in: InteractiveMarker.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  - -
The main interactive marker object.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
buttonClick(control, event3d) -
-
Handle a button click.
-
  -
feedbackEvent(type, control) -
-
Dispatch the given event type.
-
  -
moveAxis(control, origAxis, event3d) -
-
Move the axis based on the given event information.
-
  -
movePlane(control, origNormal, event3d) -
-
Move with respect to the plane based on the contorl and event.
-
  -
onServerSetPose(event) -
-
Update the marker based when the pose is set from the server.
-
  -
rotateAxis(control, origOrientation, event3d) -
-
Rotate based on the control and event given.
-
  -
setOrientation(control, event3d) -
-
Handle a user pose change for the orientation.
-
  -
setPosition(control, event3d) -
-
Handle a user pose change for the position.
-
  -
showMenu(control, event) -
-
Show the interactive marker menu associated with this marker.
-
  -
startDrag(control, event3d) -
-
Start a drag action.
-
  -
stopDrag(control, event3d) -
-
Stop a drag action.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.InteractiveMarker(options) -
- -
- The main interactive marker object. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * handle - the ROS3D.InteractiveMarkerHandle for this marker - * camera - the main camera associated with the viewer for this marker - * path (optional) - the base path to any meshes that will be loaded
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - buttonClick(control, event3d) - -
-
- Handle a button click. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - feedbackEvent(type, control) - -
-
- Dispatch the given event type. - - -
- - - - -
-
Parameters:
- -
- type - -
-
- the type of event
- -
- control - -
-
- the control to use
- -
- - - - - - - - -
- - -
- - - moveAxis(control, origAxis, event3d) - -
-
- Move the axis based on the given event information. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- origAxis - -
-
- the origin of the axis
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - movePlane(control, origNormal, event3d) - -
-
- Move with respect to the plane based on the contorl and event. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- origNormal - -
-
- the normal of the origin
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - onServerSetPose(event) - -
-
- Update the marker based when the pose is set from the server. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - rotateAxis(control, origOrientation, event3d) - -
-
- Rotate based on the control and event given. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- origOrientation - -
-
- the orientation of the origin
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - setOrientation(control, event3d) - -
-
- Handle a user pose change for the orientation. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - setPosition(control, event3d) - -
-
- Handle a user pose change for the position. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - showMenu(control, event) - -
-
- Show the interactive marker menu associated with this marker. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- event - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - startDrag(control, event3d) - -
-
- Start a drag action. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - -
- - -
- - - stopDrag(control, event3d) - -
-
- Stop a drag action. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control to use
- -
- event3d - -
-
- the event that caused this
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.InteractiveMarkerClient.html b/doc/symbols/ROS3D.InteractiveMarkerClient.html deleted file mode 100644 index 633013ac..00000000 --- a/doc/symbols/ROS3D.InteractiveMarkerClient.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.InteractiveMarkerClient - - - - - - - - - - - - - -
- -

- - Class ROS3D.InteractiveMarkerClient -

- - -

- - - - - - -
Defined in: InteractiveMarkerClient.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  - -
A client for an interactive marker topic.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
eraseIntMarker(intMarkerName) -
-
Erase the interactive marker with the given name.
-
  -
processInit(initMessage) -
-
Process the given interactive marker initialization message.
-
  -
processUpdate(initMessage) -
-
Process the given interactive marker update message.
-
  -
subscribe(topic) -
-
Subscribe to the given interactive marker topic.
-
  - -
Unsubscribe from the current interactive marker topic.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.InteractiveMarkerClient(options) -
- -
- A client for an interactive marker topic. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * ros - a handle to the ROS connection - * tfClient - a handle to the TF client - * topic (optional) - the topic to subscribe to, like '/basic_controls' - * path (optional) - the base path to any meshes that will be loaded - * camera - the main camera associated with the viewer for this marker client - * rootObject (optional) - the root THREE 3D object to render to
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - eraseIntMarker(intMarkerName) - -
-
- Erase the interactive marker with the given name. - - -
- - - - -
-
Parameters:
- -
- intMarkerName - -
-
- the interactive marker name to delete
- -
- - - - - - - - -
- - -
- - - processInit(initMessage) - -
-
- Process the given interactive marker initialization message. - - -
- - - - -
-
Parameters:
- -
- initMessage - -
-
- the interactive marker initialization message to process
- -
- - - - - - - - -
- - -
- - - processUpdate(initMessage) - -
-
- Process the given interactive marker update message. - - -
- - - - -
-
Parameters:
- -
- initMessage - -
-
- the interactive marker update message to process
- -
- - - - - - - - -
- - -
- - - subscribe(topic) - -
-
- Subscribe to the given interactive marker topic. This will unsubscribe from any current topics. - - -
- - - - -
-
Parameters:
- -
- topic - -
-
- the topic to subscribe to, like '/basic_controls'
- -
- - - - - - - - -
- - -
- - - unsubscribe() - -
-
- Unsubscribe from the current interactive marker topic. - - -
- - - - - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.InteractiveMarkerControl.html b/doc/symbols/ROS3D.InteractiveMarkerControl.html deleted file mode 100644 index 94fa9537..00000000 --- a/doc/symbols/ROS3D.InteractiveMarkerControl.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.InteractiveMarkerControl - - - - - - - - - - - - - -
- -

- - Class ROS3D.InteractiveMarkerControl -

- - -

- - - - - - -
Defined in: InteractiveMarkerControl.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  - -
The main marker control object for an interactive marker.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
<inner>   -
stopPropagation(event) -
-
Install default listeners for highlighting / dragging.
-
  -
updateMatrixWorld(force) -
-
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.InteractiveMarkerControl(options) -
- -
- The main marker control object for an interactive marker. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * parent - the parent of this control - * message - the interactive marker control message - * camera - the main camera associated with the viewer for this marker client - * path (optional) - the base path to any meshes that will be loaded
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
<inner> - - - stopPropagation(event) - -
-
- Install default listeners for highlighting / dragging. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event to stop
- -
- - - - - - - - -
- - -
- - - updateMatrixWorld(force) - -
-
- - - -
- - - - -
-
Parameters:
- -
- force - -
-
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.InteractiveMarkerHandle.html b/doc/symbols/ROS3D.InteractiveMarkerHandle.html deleted file mode 100644 index 60df957f..00000000 --- a/doc/symbols/ROS3D.InteractiveMarkerHandle.html +++ /dev/null @@ -1,827 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.InteractiveMarkerHandle - - - - - - - - - - - - - -
- -

- - Class ROS3D.InteractiveMarkerHandle -

- - -

- - - - - - -
Defined in: InteractiveMarkerHandle.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  - -
Handle with signals for a single interactive marker.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  - -
Emit the new pose that has come from the server.
-
  -
onButtonClick(event) -
-
Send the button click feedback to the server.
-
  -
onMenuSelect(event) -
-
Send the menu select feedback to the server.
-
  -
onMouseDown(event) -
-
Send the mousedown feedback to the server.
-
  -
onMouseUp(event) -
-
Send the mouseup feedback to the server.
-
  -
sendFeedback(eventType, clickPosition, menuEntryID, controlName) -
-
Send feedback to the interactive marker server.
-
  - -
Set the pose from the client based on the given event.
-
  -
setPoseFromServer(poseMsg) -
-
Update the pose based on the pose given by the server.
-
  - -
Subscribe to the TF associated with this interactive marker.
-
  -
tfUpdate(transformMsg) -
-
Update the pose based on the TF given by the server.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.InteractiveMarkerHandle(options) -
- -
- Handle with signals for a single interactive marker. - -Emits the following events: - * 'pose' - emitted when a new pose comes from the server - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * message - the interactive marker message - * feedbackTopic - the ROSLIB.Topic associated with the feedback - * tfClient - a handle to the TF client to use
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - emitServerPoseUpdate() - -
-
- Emit the new pose that has come from the server. - - -
- - - - - - - - - - - -
- - -
- - - onButtonClick(event) - -
-
- Send the button click feedback to the server. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event associated with the button click
- -
- - - - - - - - -
- - -
- - - onMenuSelect(event) - -
-
- Send the menu select feedback to the server. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event associated with the menu select
- -
- - - - - - - - -
- - -
- - - onMouseDown(event) - -
-
- Send the mousedown feedback to the server. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event associated with the mousedown
- -
- - - - - - - - -
- - -
- - - onMouseUp(event) - -
-
- Send the mouseup feedback to the server. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event associated with the mouseup
- -
- - - - - - - - -
- - -
- - - sendFeedback(eventType, clickPosition, menuEntryID, controlName) - -
-
- Send feedback to the interactive marker server. - - -
- - - - -
-
Parameters:
- -
- eventType - -
-
- the type of event that happened
- -
- clickPosition - -
-
(optional) - the position in ROS space the click happened
- -
- menuEntryID - -
-
(optional) - the menu entry ID that is associated
- -
- controlName - -
-
- the name of the control
- -
- - - - - - - - -
- - -
- - - setPoseFromClient(event) - -
-
- Set the pose from the client based on the given event. - - -
- - - - -
-
Parameters:
- -
- event - -
-
- the event to base the change off of
- -
- - - - - - - - -
- - -
- - - setPoseFromServer(poseMsg) - -
-
- Update the pose based on the pose given by the server. - - -
- - - - -
-
Parameters:
- -
- poseMsg - -
-
- the pose given by the server
- -
- - - - - - - - -
- - -
- - - subscribeTf() - -
-
- Subscribe to the TF associated with this interactive marker. - - -
- - - - - - - - - - - -
- - -
- - - tfUpdate(transformMsg) - -
-
- Update the pose based on the TF given by the server. - - -
- - - - -
-
Parameters:
- -
- transformMsg - -
-
- the TF given by the server
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.InteractiveMarkerMenu.html b/doc/symbols/ROS3D.InteractiveMarkerMenu.html deleted file mode 100644 index efe04547..00000000 --- a/doc/symbols/ROS3D.InteractiveMarkerMenu.html +++ /dev/null @@ -1,526 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.InteractiveMarkerMenu - - - - - - - - - - - - - -
- -

- - Class ROS3D.InteractiveMarkerMenu -

- - -

- - - - - - -
Defined in: InteractiveMarkerMenu.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  - -
A menu for an interactive marker.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
hide(event) -
-
Hide the menu DOM element.
-
<inner>   -
makeUl(parentDomElem, parentMenu) -
-
Create the HTML UL element for the menu and link it to the parent.
-
  -
show(control, event) -
-
Shoe the menu DOM element.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.InteractiveMarkerMenu(options) -
- -
- A menu for an interactive marker. This will be overlayed on the canvas. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * menuEntries - the menu entries to add - * className (optional) - a custom CSS class for the menu div - * entryClassName (optional) - a custom CSS class for the menu entry - * overlayClassName (optional) - a custom CSS class for the menu overlay
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - hide(event) - -
-
- Hide the menu DOM element. - - -
- - - - -
-
Parameters:
- -
- event - -
-
(optional) - the event that caused this
- -
- - - - - - - - -
- - -
<inner> - - - makeUl(parentDomElem, parentMenu) - -
-
- Create the HTML UL element for the menu and link it to the parent. - - -
- - - - -
-
Parameters:
- -
- parentDomElem - -
-
- the parent DOM element
- -
- parentMenu - -
-
- the parent menu
- -
- - - - - - - - -
- - -
- - - show(control, event) - -
-
- Shoe the menu DOM element. - - -
- - - - -
-
Parameters:
- -
- control - -
-
- the control for the menu
- -
- event - -
-
- the event that caused this
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.Marker.html b/doc/symbols/ROS3D.Marker.html deleted file mode 100644 index c9edbf0f..00000000 --- a/doc/symbols/ROS3D.Marker.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.Marker - - - - - - - - - - - - - -
- -

- - Class ROS3D.Marker -

- - -

- - - - - - -
Defined in: Marker.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.Marker(options) -
-
A Marker can convert a ROS marker message into a THREE object.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
setPose(pose) -
-
Set the pose of this marker to the given values.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.Marker(options) -
- -
- A Marker can convert a ROS marker message into a THREE object. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * path - the base path or URL for any mesh files that will be loaded for this marker - * message - the marker message
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - setPose(pose) - -
-
- Set the pose of this marker to the given values. - - -
- - - - -
-
Parameters:
- -
- pose - -
-
- the pose to set for this marker
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.MarkerClient.html b/doc/symbols/ROS3D.MarkerClient.html deleted file mode 100644 index 667d51bf..00000000 --- a/doc/symbols/ROS3D.MarkerClient.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.MarkerClient - - - - - - - - - - - - - -
- -

- - Class ROS3D.MarkerClient -

- - -

- - - - - - -
Defined in: MarkerClient.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.MarkerClient(options) -
-
A marker client that listens to a given marker topic.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.MarkerClient(options) -
- -
- A marker client that listens to a given marker topic. - -Emits the following events: - * 'change' - there was an update or change in the marker - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * ros - the ROSLIB.Ros connection handle - * topic - the marker topic to listen to - * tfClient - the TF client handle to use - * rootObject (optional) - the root object to add this marker to
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.MeshResource.html b/doc/symbols/ROS3D.MeshResource.html deleted file mode 100644 index 7880460a..00000000 --- a/doc/symbols/ROS3D.MeshResource.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.MeshResource - - - - - - - - - - - - - -
- -

- - Class ROS3D.MeshResource -

- - -

- - - - - - -
Defined in: MeshResource.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.MeshResource(options) -
-
A MeshResource is an THREE object that will load from a external mesh file.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.MeshResource(options) -
- -
- A MeshResource is an THREE object that will load from a external mesh file. Currently loads -Collada files. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * path (optional) - the base path to the associated models that will be loaded - * resource - the resource file name to load - * warnings (optional) - if warnings should be printed
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.MouseHandler.html b/doc/symbols/ROS3D.MouseHandler.html deleted file mode 100644 index 1d4100ed..00000000 --- a/doc/symbols/ROS3D.MouseHandler.html +++ /dev/null @@ -1,522 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.MouseHandler - - - - - - - - - - - - - -
- -

- - Class ROS3D.MouseHandler -

- - -

- - - - - - -
Defined in: MouseHandler.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.MouseHandler(options) -
-
A handler for mouse events within a 3D viewer.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
destroy() -
-
Destroy this mouse handler and its associated listeners.
-
  -
notify(target, type, event3D) -
-
Notify the listener of the type of event that occurred.
-
  -
processDomEvent(domEvent) -
-
Process the particular DOM even that has occurred based on the mouse's position in the scene.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.MouseHandler(options) -
- -
- A handler for mouse events within a 3D viewer. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * renderer - the main renderer - * camera - the main camera in the scene - * rootObject - the root object to check for mouse events - * fallbackTarget - the fallback target, e.g., the camera controls
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - destroy() - -
-
- Destroy this mouse handler and its associated listeners. - - -
- - - - - - - - - - - -
- - -
- - - notify(target, type, event3D) - -
-
- Notify the listener of the type of event that occurred. - - -
- - - - -
-
Parameters:
- -
- target - -
-
- the target of the event
- -
- type - -
-
- the type of event that occurred
- -
- event3D - -
-
- the 3D mouse even information
- -
- - - - - -
-
Returns:
- -
if an event was canceled
- -
- - - - -
- - -
- - - processDomEvent(domEvent) - -
-
- Process the particular DOM even that has occurred based on the mouse's position in the scene. - - -
- - - - -
-
Parameters:
- -
- domEvent - -
-
- the DOM event to process
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.OccupancyGrid.html b/doc/symbols/ROS3D.OccupancyGrid.html deleted file mode 100644 index 188ec5b9..00000000 --- a/doc/symbols/ROS3D.OccupancyGrid.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.OccupancyGrid - - - - - - - - - - - - - -
- -

- - Class ROS3D.OccupancyGrid -

- - -

- - - - - - -
Defined in: OccupancyGrid.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.OccupancyGrid(options) -
-
An OccupancyGrid can convert a ROS occupancy grid message into a THREE object.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.OccupancyGrid(options) -
- -
- An OccupancyGrid can convert a ROS occupancy grid message into a THREE object. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * message - the occupancy grid message
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.OccupancyGridClient.html b/doc/symbols/ROS3D.OccupancyGridClient.html deleted file mode 100644 index 87c82117..00000000 --- a/doc/symbols/ROS3D.OccupancyGridClient.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.OccupancyGridClient - - - - - - - - - - - - - -
- -

- - Class ROS3D.OccupancyGridClient -

- - -

- - - - - - -
Defined in: OccupancyGridClient.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  - -
An occupancy grid client that listens to a given map topic.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.OccupancyGridClient(options) -
- -
- 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 - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * ros - the ROSLIB.Ros connection handle - * topic (optional) - the map topic to listen to - * continuous (optional) - if the map should be continuously loaded (e.g., for SLAM) - * rootObject (optional) - the root object to add this marker to
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.OrbitControls.html b/doc/symbols/ROS3D.OrbitControls.html deleted file mode 100644 index d2ef0a77..00000000 --- a/doc/symbols/ROS3D.OrbitControls.html +++ /dev/null @@ -1,1013 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.OrbitControls - - - - - - - - - - - - - -
- -

- - Class ROS3D.OrbitControls -

- - -

- - - - - - -
Defined in: OrbitControls.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.OrbitControls(scene, camera, userZoomSpeed, userRotateSpeed, autoRotate, autoRotate) -
-
Behaves like THREE.OrbitControls, but uses right-handed coordinates and z as up vector.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
<inner>   -
onMouseDown(event3D) -
-
Handle the mousedown 3D event.
-
<inner>   -
onMouseMove(event3D) -
-
Handle the movemove 3D event.
-
<inner>   -
onMouseUp(event3D) -
-
Handle the mouseup 3D event.
-
<inner>   -
onMouseWheel(event3D) -
-
Handle the mousewheel 3D event.
-
<inner>   -
onTouchDown(event3D) -
-
Handle the touchdown 3D event.
-
<inner>   -
onTouchMove(event3D) -
-
Handle the touchmove 3D event.
-
  -
rotateDown(angle) -
-
Rotate the camera down by the given angle.
-
  -
rotateLeft(angle) -
-
Rotate the camera to the left by the given angle.
-
  -
rotateRight(angle) -
-
Rotate the camera to the right by the given angle.
-
  -
rotateUp(angle) -
-
Rotate the camera up by the given angle.
-
  - -
Display the main axes for 1 second.
-
  -
update() -
-
Update the camera to the current settings.
-
  -
zoomIn(zoomScale) -
-
Zoom in by the given scale.
-
  -
zoomOut(zoomScale) -
-
Zoom out by the given scale.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.OrbitControls(scene, camera, userZoomSpeed, userRotateSpeed, autoRotate, autoRotate) -
- -
- Behaves like THREE.OrbitControls, but uses right-handed coordinates and z as up vector. - -
- - - - - -
-
Parameters:
- -
- scene - -
-
- the global scene to use
- -
- camera - -
-
- the camera to use
- -
- userZoomSpeed - -
-
(optional) - the speed for zooming
- -
- userRotateSpeed - -
-
(optional) - the speed for rotating
- -
- autoRotate - -
-
(optional) - if the orbit should auto rotate
- -
- autoRotate - -
-
(optional) - the speed for auto rotating
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
<inner> - - - onMouseDown(event3D) - -
-
- Handle the mousedown 3D event. - - -
- - - - -
-
Parameters:
- -
- event3D - -
-
- the 3D event to handle
- -
- - - - - - - - -
- - -
<inner> - - - onMouseMove(event3D) - -
-
- Handle the movemove 3D event. - - -
- - - - -
-
Parameters:
- -
- event3D - -
-
- the 3D event to handle
- -
- - - - - - - - -
- - -
<inner> - - - onMouseUp(event3D) - -
-
- Handle the mouseup 3D event. - - -
- - - - -
-
Parameters:
- -
- event3D - -
-
- the 3D event to handle
- -
- - - - - - - - -
- - -
<inner> - - - onMouseWheel(event3D) - -
-
- Handle the mousewheel 3D event. - - -
- - - - -
-
Parameters:
- -
- event3D - -
-
- the 3D event to handle
- -
- - - - - - - - -
- - -
<inner> - - - onTouchDown(event3D) - -
-
- Handle the touchdown 3D event. - - -
- - - - -
-
Parameters:
- -
- event3D - -
-
- the 3D event to handle
- -
- - - - - - - - -
- - -
<inner> - - - onTouchMove(event3D) - -
-
- Handle the touchmove 3D event. - - -
- - - - -
-
Parameters:
- -
- event3D - -
-
- the 3D event to handle
- -
- - - - - - - - -
- - -
- - - rotateDown(angle) - -
-
- Rotate the camera down by the given angle. - - -
- - - - -
-
Parameters:
- -
- angle - -
-
(optional) - the angle to rotate by
- -
- - - - - - - - -
- - -
- - - rotateLeft(angle) - -
-
- Rotate the camera to the left by the given angle. - - -
- - - - -
-
Parameters:
- -
- angle - -
-
(optional) - the angle to rotate by
- -
- - - - - - - - -
- - -
- - - rotateRight(angle) - -
-
- Rotate the camera to the right by the given angle. - - -
- - - - -
-
Parameters:
- -
- angle - -
-
(optional) - the angle to rotate by
- -
- - - - - - - - -
- - -
- - - rotateUp(angle) - -
-
- Rotate the camera up by the given angle. - - -
- - - - -
-
Parameters:
- -
- angle - -
-
(optional) - the angle to rotate by
- -
- - - - - - - - -
- - -
- - - showAxes() - -
-
- Display the main axes for 1 second. - - -
- - - - - - - - - - - -
- - -
- - - update() - -
-
- Update the camera to the current settings. - - -
- - - - - - - - - - - -
- - -
- - - zoomIn(zoomScale) - -
-
- Zoom in by the given scale. - - -
- - - - -
-
Parameters:
- -
- zoomScale - -
-
(optional) - the scale to zoom in by
- -
- - - - - - - - -
- - -
- - - zoomOut(zoomScale) - -
-
- Zoom out by the given scale. - - -
- - - - -
-
Parameters:
- -
- zoomScale - -
-
(optional) - the scale to zoom in by
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.SceneNode.html b/doc/symbols/ROS3D.SceneNode.html deleted file mode 100644 index d0ce47c4..00000000 --- a/doc/symbols/ROS3D.SceneNode.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.SceneNode - - - - - - - - - - - - - -
- -

- - Class ROS3D.SceneNode -

- - -

- - - - - - -
Defined in: SceneNode.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.SceneNode(options) -
-
A SceneNode can be used to keep track of a 3D object with respect to a ROS frame within a scene.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.SceneNode(options) -
- -
- A SceneNode can be used to keep track of a 3D object with respect to a ROS frame within a scene. - -
- - - - - -
-
Parameters:
- -
- 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
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.TriangleList.html b/doc/symbols/ROS3D.TriangleList.html deleted file mode 100644 index d19d182e..00000000 --- a/doc/symbols/ROS3D.TriangleList.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.TriangleList - - - - - - - - - - - - - -
- -

- - Class ROS3D.TriangleList -

- - -

- - - - - - -
Defined in: TriangleList.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.TriangleList(options) -
-
A TriangleList is a THREE object that can be used to display a list of triangles as a geometry.
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
setColor(hex) -
-
Set the color of this object to the given hex value.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.TriangleList(options) -
- -
- A TriangleList is a THREE object that can be used to display a list of triangles as a geometry. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * material (optional) - the material to use for the object - * vertices - the array of vertices to use - * colors - the associated array of colors to use
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - setColor(hex) - -
-
- Set the color of this object to the given hex value. - - -
- - - - -
-
Parameters:
- -
- hex - -
-
- the hex value of the color to set
- -
- - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.Urdf.html b/doc/symbols/ROS3D.Urdf.html deleted file mode 100644 index 9b69fb66..00000000 --- a/doc/symbols/ROS3D.Urdf.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.Urdf - - - - - - - - - - - - - -
- -

- - Class ROS3D.Urdf -

- - -

- - - - - - -
Defined in: Urdf.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.Urdf(options) -
-
A URDF can be used to load a ROSLIB.UrdfModel and its associated models into a 3D object.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.Urdf(options) -
- -
- A URDF can be used to load a ROSLIB.UrdfModel and its associated models into a 3D object. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * urdfModel - the ROSLIB.UrdfModel to load - * tfClient - the TF client handle to use - * path (optional) - the base path to the associated Collada models that will be loaded
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.UrdfClient.html b/doc/symbols/ROS3D.UrdfClient.html deleted file mode 100644 index 4a6d2368..00000000 --- a/doc/symbols/ROS3D.UrdfClient.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.UrdfClient - - - - - - - - - - - - - -
- -

- - Class ROS3D.UrdfClient -

- - -

- - - - - - -
Defined in: UrdfClient.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.UrdfClient(options) -
-
A URDF client can be used to load a URDF and its associated models into a 3D object from the ROS -parameter server.
-
- - - - - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.UrdfClient(options) -
- -
- A URDF client can be used to load a URDF and its associated models into a 3D object from the ROS -parameter server. - -Emits the following events: -* 'change' - emited after the URDF and its meshes have been loaded into the root object - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * ros - the ROSLIB.Ros connection handle - * param (optional) - the paramter to load the URDF from, like 'robot_description' - * tfClient - the TF client handle to use - * path (optional) - the base path to the associated Collada models that will be loaded - * rootObject (optional) - the root object to add this marker to
- -
- - - - - - - - -
- - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/ROS3D.Viewer.html b/doc/symbols/ROS3D.Viewer.html deleted file mode 100644 index bb457d95..00000000 --- a/doc/symbols/ROS3D.Viewer.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - - - - JsDoc Reference - ROS3D.Viewer - - - - - - - - - - - - - -
- -

- - Class ROS3D.Viewer -

- - -

- - - - - - -
Defined in: Viewer.js. - -

- - - - - - - - - - - - - - - - - -
Class Summary
Constructor AttributesConstructor Name and Description
  -
- ROS3D.Viewer(options) -
-
A Viewer can be used to render an interactive 3D scene to a HTML5 canvas.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
addObject(object, selectable) -
-
Add the given THREE Object3D to the global scene in the viewer.
-
<inner>   -
draw() -
-
Renders the associated scene to the that.
-
- - - - - - - - - -
-
- Class Detail -
- -
- ROS3D.Viewer(options) -
- -
- A Viewer can be used to render an interactive 3D scene to a HTML5 canvas. - -
- - - - - -
-
Parameters:
- -
- options - -
-
- object with following keys: - * divID - the ID of the div to place the viewer in - * width - the initial width, in pixels, of the canvas - * height - the initial height, in pixels, of the canvas - * background (optional) - the color to render the background, like '#efefef' - * antialias (optional) - if antialiasing should be used - * intensity (optional) - the lighting intensity setting to use
- -
- - - - - - - - -
- - - - - - - -
- Method Detail -
- - -
- - - addObject(object, selectable) - -
-
- Add the given THREE Object3D to the global scene in the viewer. - - -
- - - - -
-
Parameters:
- -
- object - -
-
- the THREE Object3D to add
- -
- selectable - -
-
(optional) - if the object should be added to the selectable list
- -
- - - - - - - - -
- - -
<inner> - - - draw() - -
-
- Renders the associated scene to the that. - - -
- - - - - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/_global_.html b/doc/symbols/_global_.html deleted file mode 100644 index 6dee9585..00000000 --- a/doc/symbols/_global_.html +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - JsDoc Reference - _global_ - - - - - - - - - - - - - -
- -

- - Built-In Namespace _global_ -

- - -

- - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - -
Field Summary
Field AttributesField Name and Description
  -
- ROS3D -
-
-
- - - - - - - - - - - - - - - -
- Field Detail -
- - -
- - - ROS3D - -
-
- - -
- Defined in: Ros3D.js. - -
Author: Russell Toris - rctoris@wpi.edu, David Gossow - dgossow@willowgarage.com. -
- - - - - - - - - - - - - - - - - - -
-
- - - -
- - Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 03 2013 18:15:58 GMT-0700 (PDT) -
- - diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_Ros3D.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_Ros3D.js.html deleted file mode 100644 index 80e52089..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_Ros3D.js.html +++ /dev/null @@ -1,177 +0,0 @@ -
  1 /**
-  2 * @author Russell Toris - rctoris@wpi.edu
-  3 * @author David Gossow - dgossow@willowgarage.com
-  4 */
-  5 
-  6 var ROS3D = ROS3D || {
-  7   REVISION : '3'
-  8 };
-  9 
- 10 // Marker types
- 11 ROS3D.MARKER_ARROW = 0;
- 12 ROS3D.MARKER_CUBE = 1;
- 13 ROS3D.MARKER_SPHERE = 2;
- 14 ROS3D.MARKER_CYLINDER = 3;
- 15 ROS3D.MARKER_LINE_STRIP = 4;
- 16 ROS3D.MARKER_LINE_LIST = 5;
- 17 ROS3D.MARKER_CUBE_LIST = 6;
- 18 ROS3D.MARKER_SPHERE_LIST = 7;
- 19 ROS3D.MARKER_POINTS = 8;
- 20 ROS3D.MARKER_TEXT_VIEW_FACING = 9;
- 21 ROS3D.MARKER_MESH_RESOURCE = 10;
- 22 ROS3D.MARKER_TRIANGLE_LIST = 11;
- 23 
- 24 // Interactive marker feedback types
- 25 ROS3D.INTERACTIVE_MARKER_KEEP_ALIVE = 0;
- 26 ROS3D.INTERACTIVE_MARKER_POSE_UPDATE = 1;
- 27 ROS3D.INTERACTIVE_MARKER_MENU_SELECT = 2;
- 28 ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK = 3;
- 29 ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN = 4;
- 30 ROS3D.INTERACTIVE_MARKER_MOUSE_UP = 5;
- 31 
- 32 // Interactive marker control types
- 33 ROS3D.INTERACTIVE_MARKER_NONE = 0;
- 34 ROS3D.INTERACTIVE_MARKER_MENU = 1;
- 35 ROS3D.INTERACTIVE_MARKER_BUTTON = 2;
- 36 ROS3D.INTERACTIVE_MARKER_MOVE_AXIS = 3;
- 37 ROS3D.INTERACTIVE_MARKER_MOVE_PLANE = 4;
- 38 ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS = 5;
- 39 ROS3D.INTERACTIVE_MARKER_MOVE_ROTATE = 6;
- 40 
- 41 // Interactive marker rotation behavior
- 42 ROS3D.INTERACTIVE_MARKER_INHERIT = 0;
- 43 ROS3D.INTERACTIVE_MARKER_FIXED = 1;
- 44 ROS3D.INTERACTIVE_MARKER_VIEW_FACING = 2;
- 45 
- 46 /**
- 47  * Create a THREE material based on the given RGBA values.
- 48  * 
- 49  * @param r - the red value
- 50  * @param g - the green value
- 51  * @param b - the blue value
- 52  * @param a - the alpha value
- 53  * @returns the THREE material
- 54  */
- 55 ROS3D.makeColorMaterial = function(r, g, b, a) {
- 56   var color = new THREE.Color();
- 57   color.setRGB(r, g, b);
- 58   if (a <= 0.99) {
- 59     return new THREE.MeshBasicMaterial({
- 60       color : color.getHex(),
- 61       opacity : a + 0.1,
- 62       transparent : true,
- 63       depthWrite : true,
- 64       blendSrc : THREE.SrcAlphaFactor,
- 65       blendDst : THREE.OneMinusSrcAlphaFactor,
- 66       blendEquation : THREE.ReverseSubtractEquation,
- 67       blending : THREE.NormalBlending
- 68     });
- 69   } else {
- 70     return new THREE.MeshLambertMaterial({
- 71       color : color.getHex(),
- 72       opacity : a,
- 73       blending : THREE.NormalBlending
- 74     });
- 75   }
- 76 };
- 77 
- 78 /**
- 79  * Return the intersection between the mouseray and the plane.
- 80  * 
- 81  * @param mouseRay - the mouse ray
- 82  * @param planeOrigin - the origin of the plane
- 83  * @param planeNormal - the normal of the plane
- 84  * @returns the intersection point
- 85  */
- 86 ROS3D.intersectPlane = function(mouseRay, planeOrigin, planeNormal) {
- 87   var vector = new THREE.Vector3();
- 88   var intersectPoint = new THREE.Vector3();
- 89   vector.subVectors(planeOrigin, mouseRay.origin);
- 90   dot = mouseRay.direction.dot(planeNormal);
- 91 
- 92   // bail if ray and plane are parallel
- 93   if (Math.abs(dot) < mouseRay.precision) {
- 94     return undefined;
- 95   }
- 96 
- 97   // calc distance to plane
- 98   scalar = planeNormal.dot(vector) / dot;
- 99 
-100   intersectPoint.addVectors(mouseRay.origin, mouseRay.direction.clone().multiplyScalar(scalar));
-101   return intersectPoint;
-102 };
-103 
-104 /**
-105  * Find the closest point on targetRay to any point on mouseRay. Math taken from 
-106  * http://paulbourke.net/geometry/lineline3d/
-107  * 
-108  * @param targetRay - the target ray to use
-109  * @param mouseRay - the mouse ray
-110  * @param the closest point between the two rays
-111  */
-112 ROS3D.findClosestPoint = function(targetRay, mouseRay) {
-113   var v13 = new THREE.Vector3;
-114   v13.subVectors(targetRay.origin, mouseRay.origin);
-115   var v43 = mouseRay.direction.clone();
-116   var v21 = targetRay.direction.clone();
-117   var d1343 = v13.dot(v43);
-118   var d4321 = v43.dot(v21);
-119   var d1321 = v13.dot(v21);
-120   var d4343 = v43.dot(v43);
-121   var d2121 = v21.dot(v21);
-122 
-123   var denom = d2121 * d4343 - d4321 * d4321;
-124   // check within a delta
-125   if (Math.abs(denom) <= 0.0001) {
-126     return undefined;
-127   }
-128   var numer = d1343 * d4321 - d1321 * d4343;
-129 
-130   var mua = numer / denom;
-131   return mua;
-132 };
-133 
-134 /**
-135  * Find the closest point between the axis and the mouse.
-136  * 
-137  * @param axisRay - the ray from the axis
-138  * @param camera - the camera to project from
-139  * @param mousePos - the mouse position
-140  * @returns the closest axis point
-141  */
-142 ROS3D.closestAxisPoint = function(axisRay, camera, mousePos) {
-143   var projector = new THREE.Projector();
-144 
-145   // project axis onto screen
-146   var o = axisRay.origin.clone();
-147   projector.projectVector(o, camera);
-148   var o2 = axisRay.direction.clone().add(axisRay.origin);
-149   projector.projectVector(o2, camera);
-150 
-151   // d is the axis vector in screen space (d = o2-o)
-152   var d = o2.clone().sub(o);
-153 
-154   // t is the 2d ray param of perpendicular projection of mousePos onto o
-155   var tmp = new THREE.Vector2;
-156   // (t = (mousePos - o) * d / (d*d))
-157   var t = tmp.subVectors(mousePos, o).dot(d) / d.dot(d);
-158 
-159   // mp is the final 2d-projected mouse pos (mp = o + d*t)
-160   var mp = new THREE.Vector2;
-161   mp.addVectors(o, d.clone().multiplyScalar(t));
-162 
-163   // go back to 3d by shooting a ray
-164   var vector = new THREE.Vector3(mp.x, mp.y, 0.5);
-165   projector.unprojectVector(vector, camera);
-166   var mpRay = new THREE.Ray(camera.position, vector.sub(camera.position).normalize());
-167 
-168   return ROS3D.findClosestPoint(axisRay, mpRay);
-169 };
-170 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarker.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarker.js.html deleted file mode 100644 index ba5ba90d..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarker.js.html +++ /dev/null @@ -1,309 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * The main interactive marker object.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *  * handle - the ROS3D.InteractiveMarkerHandle for this marker
- 11  *  * camera - the main camera associated with the viewer for this marker
- 12  *  * path (optional) - the base path to any meshes that will be loaded
- 13  */
- 14 ROS3D.InteractiveMarker = function(options) {
- 15   THREE.Object3D.call(this);
- 16   THREE.EventDispatcher.call(this);
- 17 
- 18   var that = this;
- 19   var options = options || {};
- 20   var handle = options.handle;
- 21   this.name = handle.name;
- 22   var camera = options.camera;
- 23   var path = options.path || '/';
- 24   this.dragging = false;
- 25 
- 26   // set the initial pose
- 27   this.onServerSetPose({
- 28     pose : handle.pose
- 29   });
- 30 
- 31   // information on where the drag started
- 32   this.dragStart = {
- 33     position : new THREE.Vector3(),
- 34     orientation : new THREE.Quaternion(),
- 35     positionWorld : new THREE.Vector3(),
- 36     orientationWorld : new THREE.Quaternion(),
- 37     event3d : {}
- 38   };
- 39 
- 40   // add each control message
- 41   handle.controls.forEach(function(controlMessage) {
- 42     that.add(new ROS3D.InteractiveMarkerControl({
- 43       parent : that,
- 44       message : controlMessage,
- 45       camera : camera,
- 46       path : path
- 47     }));
- 48   });
- 49 
- 50   // check for any menus
- 51   if (handle.menuEntries.length > 0) {
- 52     this.menu = new ROS3D.InteractiveMarkerMenu({
- 53       menuEntries : handle.menuEntries
- 54     });
- 55 
- 56     // forward menu select events
- 57     this.menu.addEventListener('menu-select', function(event) {
- 58       that.dispatchEvent(event);
- 59     });
- 60   }
- 61 };
- 62 ROS3D.InteractiveMarker.prototype.__proto__ = THREE.Object3D.prototype;
- 63 
- 64 /**
- 65  * Show the interactive marker menu associated with this marker.
- 66  * 
- 67  * @param control - the control to use
- 68  * @param event - the event that caused this
- 69  */
- 70 ROS3D.InteractiveMarker.prototype.showMenu = function(control, event) {
- 71   if (this.menu) {
- 72     this.menu.show(control, event);
- 73   }
- 74 };
- 75 
- 76 /**
- 77  * Move the axis based on the given event information.
- 78  * 
- 79  * @param control - the control to use
- 80  * @param origAxis - the origin of the axis
- 81  * @param event3d - the event that caused this
- 82  */
- 83 ROS3D.InteractiveMarker.prototype.moveAxis = function(control, origAxis, event3d) {
- 84   if (this.dragging) {
- 85     var currentControlOri = control.currentControlOri;
- 86     var axis = origAxis.clone().applyQuaternion(currentControlOri);
- 87     // get move axis in world coords
- 88     var originWorld = this.dragStart.event3d.intersection.point;
- 89     var axisWorld = axis.clone().applyQuaternion(this.dragStart.orientationWorld.clone());
- 90 
- 91     var axisRay = new THREE.Ray(originWorld, axisWorld);
- 92 
- 93     // find closest point to mouse on axis
- 94     var t = ROS3D.closestAxisPoint(axisRay, event3d.camera, event3d.mousePos);
- 95 
- 96     // offset from drag start position
- 97     var p = new THREE.Vector3;
- 98     p.addVectors(this.dragStart.position, axis.clone().applyQuaternion(this.dragStart.orientation)
- 99         .multiplyScalar(t));
-100     this.setPosition(control, p);
-101 
-102     event3d.stopPropagation();
-103   }
-104 };
-105 
-106 /**
-107  * Move with respect to the plane based on the contorl and event.
-108  * 
-109  * @param control - the control to use
-110  * @param origNormal - the normal of the origin
-111  * @param event3d - the event that caused this
-112  */
-113 ROS3D.InteractiveMarker.prototype.movePlane = function(control, origNormal, event3d) {
-114   if (this.dragging) {
-115     var currentControlOri = control.currentControlOri;
-116     var normal = origNormal.clone().applyQuaternion(currentControlOri);
-117     // get plane params in world coords
-118     var originWorld = this.dragStart.event3d.intersection.point;
-119     var normalWorld = normal.clone().applyQuaternion(this.dragStart.orientationWorld);
-120 
-121     // intersect mouse ray with plane
-122     var intersection = ROS3D.intersectPlane(event3d.mouseRay, originWorld, normalWorld);
-123 
-124     // offset from drag start position
-125     var p = new THREE.Vector3;
-126     p.subVectors(intersection, originWorld);
-127     p.add(this.dragStart.positionWorld);
-128     this.setPosition(control, p);
-129     event3d.stopPropagation();
-130   }
-131 };
-132 
-133 /**
-134  * Rotate based on the control and event given.
-135  * 
-136  * @param control - the control to use
-137  * @param origOrientation - the orientation of the origin
-138  * @param event3d - the event that caused this
-139  */
-140 ROS3D.InteractiveMarker.prototype.rotateAxis = function(control, origOrientation, event3d) {
-141   if (this.dragging) {
-142     control.updateMatrixWorld();
-143 
-144     var currentControlOri = control.currentControlOri;
-145     var orientation = currentControlOri.clone().multiply(origOrientation.clone());
-146 
-147     var normal = (new THREE.Vector3(1, 0, 0)).applyQuaternion(orientation);
-148 
-149     // get plane params in world coords
-150     var originWorld = this.dragStart.event3d.intersection.point;
-151     var normalWorld = normal.applyQuaternion(this.dragStart.orientationWorld);
-152 
-153     // intersect mouse ray with plane
-154     var intersection = ROS3D.intersectPlane(event3d.mouseRay, originWorld, normalWorld);
-155 
-156     // offset local origin to lie on intersection plane
-157     var normalRay = new THREE.Ray(this.dragStart.positionWorld, normalWorld);
-158     var rotOrigin = ROS3D.intersectPlane(normalRay, originWorld, normalWorld);
-159 
-160     // rotates from world to plane coords
-161     var orientationWorld = this.dragStart.orientationWorld.clone().multiply(orientation);
-162     var orientationWorldInv = orientationWorld.clone().inverse();
-163 
-164     // rotate original and current intersection into local coords
-165     intersection.sub(rotOrigin);
-166     intersection.applyQuaternion(orientationWorldInv);
-167 
-168     var origIntersection = this.dragStart.event3d.intersection.point.clone();
-169     origIntersection.sub(rotOrigin);
-170     origIntersection.applyQuaternion(orientationWorldInv);
-171 
-172     // compute relative 2d angle
-173     var a1 = Math.atan2(intersection.y, intersection.z);
-174     var a2 = Math.atan2(origIntersection.y, origIntersection.z);
-175     var a = a2 - a1;
-176 
-177     var rot = new THREE.Quaternion();
-178     rot.setFromAxisAngle(normal, a);
-179 
-180     // rotate
-181     this.setOrientation(control, rot.multiply(this.dragStart.orientationWorld));
-182 
-183     // offset from drag start position
-184     event3d.stopPropagation();
-185   }
-186 };
-187 
-188 /**
-189  * Dispatch the given event type.
-190  * 
-191  * @param type - the type of event
-192  * @param control - the control to use
-193  */
-194 ROS3D.InteractiveMarker.prototype.feedbackEvent = function(type, control) {
-195   this.dispatchEvent({
-196     type : type,
-197     position : this.position.clone(),
-198     orientation : this.quaternion.clone(),
-199     controlName : control.name
-200   });
-201 };
-202 
-203 /**
-204  * Start a drag action.
-205  * 
-206  * @param control - the control to use
-207  * @param event3d - the event that caused this
-208  */
-209 ROS3D.InteractiveMarker.prototype.startDrag = function(control, event3d) {
-210   if (event3d.domEvent.button === 0) {
-211     event3d.stopPropagation();
-212     this.dragging = true;
-213     this.updateMatrixWorld(true);
-214     var scale = new THREE.Vector3();
-215     this.matrixWorld
-216         .decompose(this.dragStart.positionWorld, this.dragStart.orientationWorld, scale);
-217     this.dragStart.position = this.position.clone();
-218     this.dragStart.orientation = this.quaternion.clone();
-219     this.dragStart.event3d = event3d;
-220 
-221     this.feedbackEvent('user-mousedown', control);
-222   }
-223 };
-224 
-225 /**
-226  * Stop a drag action.
-227  * 
-228  * @param control - the control to use
-229  * @param event3d - the event that caused this
-230  */
-231 ROS3D.InteractiveMarker.prototype.stopDrag = function(control, event3d) {
-232   if (event3d.domEvent.button === 0) {
-233     event3d.stopPropagation();
-234     this.dragging = false;
-235     this.dragStart.event3d = {};
-236     this.onServerSetPose(this.bufferedPoseEvent);
-237     this.bufferedPoseEvent = undefined;
-238 
-239     this.feedbackEvent('user-mouseup', control);
-240   }
-241 };
-242 
-243 /**
-244  * Handle a button click.
-245  * 
-246  * @param control - the control to use
-247  * @param event3d - the event that caused this
-248  */
-249 ROS3D.InteractiveMarker.prototype.buttonClick = function(control, event3d) {
-250   event3d.stopPropagation();
-251   this.feedbackEvent('user-button-click', control);
-252 };
-253 
-254 /**
-255  * Handle a user pose change for the position.
-256  * 
-257  * @param control - the control to use
-258  * @param event3d - the event that caused this
-259  */
-260 ROS3D.InteractiveMarker.prototype.setPosition = function(control, position) {
-261   this.position = position;
-262   this.feedbackEvent('user-pose-change', control);
-263 };
-264 
-265 /**
-266  * Handle a user pose change for the orientation.
-267  * 
-268  * @param control - the control to use
-269  * @param event3d - the event that caused this
-270  */
-271 ROS3D.InteractiveMarker.prototype.setOrientation = function(control, orientation) {
-272   orientation.normalize();
-273   this.quaternion = orientation;
-274   this.feedbackEvent('user-pose-change', control);
-275 };
-276 
-277 /**
-278  * Update the marker based when the pose is set from the server.
-279  * 
-280  * @param event - the event that caused this
-281  */
-282 ROS3D.InteractiveMarker.prototype.onServerSetPose = function(event) {
-283   if (event !== undefined) {
-284     // don't update while dragging
-285     if (this.dragging) {
-286       this.bufferedPoseEvent = event;
-287     } else {
-288       var pose = event.pose;
-289 
-290       this.position.x = pose.position.x;
-291       this.position.y = pose.position.y;
-292       this.position.z = pose.position.z;
-293 
-294       this.useQuaternion = true;
-295       this.quaternion = new THREE.Quaternion(pose.orientation.x, pose.orientation.y,
-296           pose.orientation.z, pose.orientation.w);
-297 
-298       this.updateMatrixWorld(true);
-299     }
-300   }
-301 };
-302 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerClient.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerClient.js.html deleted file mode 100644 index 91b8c222..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerClient.js.html +++ /dev/null @@ -1,189 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * A client for an interactive marker topic.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *  * ros - a handle to the ROS connection
- 11  *  * tfClient - a handle to the TF client
- 12  *  * topic (optional) - the topic to subscribe to, like '/basic_controls'
- 13  *  * path (optional) - the base path to any meshes that will be loaded
- 14  *  * camera - the main camera associated with the viewer for this marker client
- 15  *  * rootObject (optional) - the root THREE 3D object to render to
- 16  */
- 17 ROS3D.InteractiveMarkerClient = function(options) {
- 18   var that = this;
- 19   var options = options || {};
- 20   this.ros = options.ros;
- 21   this.tfClient = options.tfClient;
- 22   this.topic = options.topic;
- 23   this.path = options.path || '/';
- 24   this.camera = options.camera;
- 25   this.rootObject = options.rootObject || new THREE.Object3D();
- 26 
- 27   this.interactiveMarkers = {};
- 28   this.updateTopic = null;
- 29   this.feedbackTopic = null;
- 30 
- 31   // check for an initial topic
- 32   if (this.topic) {
- 33     this.subscribe(this.topic);
- 34   }
- 35 };
- 36 
- 37 /**
- 38  * Subscribe to the given interactive marker topic. This will unsubscribe from any current topics.
- 39  * 
- 40  * @param topic - the topic to subscribe to, like '/basic_controls'
- 41  */
- 42 ROS3D.InteractiveMarkerClient.prototype.subscribe = function(topic) {
- 43   // unsubscribe to the other topics
- 44   this.unsubscribe();
- 45 
- 46   this.updateTopic = new ROSLIB.Topic({
- 47     ros : this.ros,
- 48     name : topic + '/tunneled/update',
- 49     messageType : 'visualization_msgs/InteractiveMarkerUpdate',
- 50     compression : 'png'
- 51   });
- 52   this.updateTopic.subscribe(this.processUpdate.bind(this));
- 53 
- 54   this.feedbackTopic = new ROSLIB.Topic({
- 55     ros : this.ros,
- 56     name : topic + '/feedback',
- 57     messageType : 'visualization_msgs/InteractiveMarkerFeedback',
- 58     compression : 'png'
- 59   });
- 60   this.feedbackTopic.advertise();
- 61 
- 62   this.initService = new ROSLIB.Service({
- 63     ros : this.ros,
- 64     name : topic + '/tunneled/get_init',
- 65     serviceType : 'demo_interactive_markers/GetInit'
- 66   });
- 67   var request = new ROSLIB.ServiceRequest({});
- 68   this.initService.callService(request, this.processInit.bind(this));
- 69 };
- 70 
- 71 /**
- 72  * Unsubscribe from the current interactive marker topic.
- 73  */
- 74 ROS3D.InteractiveMarkerClient.prototype.unsubscribe = function() {
- 75   if (this.updateTopic) {
- 76     this.updateTopic.unsubscribe();
- 77   }
- 78   if (this.feedbackTopic) {
- 79     this.feedbackTopic.unadvertise();
- 80   }
- 81   // erase all markers
- 82   for (intMarkerName in this.interactiveMarkers) {
- 83     this.eraseIntMarker(intMarkerName);
- 84   }
- 85   this.interactiveMarkers = {};
- 86 };
- 87 
- 88 /**
- 89  * Process the given interactive marker initialization message.
- 90  * 
- 91  * @param initMessage - the interactive marker initialization message to process
- 92  */
- 93 ROS3D.InteractiveMarkerClient.prototype.processInit = function(initMessage) {
- 94   var message = initMessage.msg;
- 95 
- 96   // erase any old markers
- 97   message.erases = [];
- 98   for (intMarkerName in this.interactiveMarkers) {
- 99     message.erases.push(intMarkerName);
-100   };
-101   message.poses = [];
-102 
-103   // treat it as an update
-104   this.processUpdate(message);
-105 };
-106 
-107 /**
-108  * Process the given interactive marker update message.
-109  * 
-110  * @param initMessage - the interactive marker update message to process
-111  */
-112 ROS3D.InteractiveMarkerClient.prototype.processUpdate = function(message) {
-113   var that = this;
-114 
-115   // erase any markers
-116   message.erases.forEach(function(name) {
-117     var marker = that.interactiveMarkers[name];
-118     that.eraseIntMarker(name);
-119   });
-120 
-121   // updates marker poses
-122   message.poses.forEach(function(poseMessage) {
-123     var marker = that.interactiveMarkers[poseMessage.name];
-124     if (marker) {
-125       marker.setPoseFromServer(poseMessage.pose);
-126     }
-127   });
-128 
-129   // add new markers
-130   message.markers.forEach(function(msg) {
-131     // get rid of anything with the same name
-132     var oldhandle = that.interactiveMarkers[msg.name];
-133     if (oldhandle) {
-134       that.eraseIntMarker(oldhandle.name);
-135     }
-136 
-137     // create the handle
-138     var handle = new ROS3D.InteractiveMarkerHandle({
-139       message : msg,
-140       feedbackTopic : that.feedbackTopic,
-141       tfClient : that.tfClient
-142     });
-143     that.interactiveMarkers[msg.name] = handle;
-144 
-145     // create the actual marker
-146     var intMarker = new ROS3D.InteractiveMarker({
-147       handle : handle,
-148       camera : that.camera,
-149       path : that.path
-150     });
-151     // add it to the scene
-152     that.rootObject.add(intMarker);
-153 
-154     // listen for any pose updates from the server
-155     handle.on('pose', function(pose) {
-156       intMarker.onServerSetPose({
-157         pose : pose
-158       });
-159     });
-160 
-161     intMarker.addEventListener('user-pose-change', handle.setPoseFromClient.bind(handle));
-162     intMarker.addEventListener('user-mousedown', handle.onMouseDown.bind(handle));
-163     intMarker.addEventListener('user-mouseup', handle.onMouseUp.bind(handle));
-164     intMarker.addEventListener('user-button-click', handle.onButtonClick.bind(handle));
-165     intMarker.addEventListener('menu-select', handle.onMenuSelect.bind(handle));
-166 
-167     // now list for any TF changes
-168     handle.subscribeTf();
-169   });
-170 };
-171 
-172 /**
-173  * Erase the interactive marker with the given name.
-174  * 
-175  * @param intMarkerName - the interactive marker name to delete
-176  */
-177 ROS3D.InteractiveMarkerClient.prototype.eraseIntMarker = function(intMarkerName) {
-178   if (this.interactiveMarkers[intMarkerName]) {
-179     delete this.interactiveMarkers[intMarkerName];
-180   }
-181 };
-182 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerControl.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerControl.js.html deleted file mode 100644 index 47118d9a..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerControl.js.html +++ /dev/null @@ -1,189 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * The main marker control object for an interactive marker.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *  * parent - the parent of this control
- 11  *  * message - the interactive marker control message
- 12  *  * camera - the main camera associated with the viewer for this marker client
- 13  *  * path (optional) - the base path to any meshes that will be loaded
- 14  */
- 15 ROS3D.InteractiveMarkerControl = function(options) {
- 16   var that = this;
- 17   THREE.Object3D.call(this);
- 18   THREE.EventDispatcher.call(this);
- 19 
- 20   var options = options || {};
- 21   this.parent = options.parent;
- 22   var message = options.message;
- 23   this.name = message.name;
- 24   this.camera = options.camera;
- 25   this.path = options.path || '/';
- 26   this.dragging = false;
- 27 
- 28   // orientation for the control
- 29   var controlOri = new THREE.Quaternion(message.orientation.x, message.orientation.y,
- 30       message.orientation.z, message.orientation.w);
- 31   controlOri.normalize();
- 32 
- 33   // transform x axis into local frame
- 34   var controlAxis = new THREE.Vector3(1, 0, 0);
- 35   controlAxis.applyQuaternion(controlOri);
- 36 
- 37   this.currentControlOri = new THREE.Quaternion();
- 38 
- 39   // determine mouse interaction
- 40   switch (message.interaction_mode) {
- 41     case ROS3D.INTERACTIVE_MARKER_MOVE_AXIS:
- 42       this.addEventListener('mousemove', this.parent.moveAxis.bind(this.parent, this, controlAxis));
- 43       this.addEventListener('touchmove', this.parent.moveAxis.bind(this.parent, this, controlAxis));
- 44       break;
- 45     case ROS3D.INTERACTIVE_MARKER_ROTATE_AXIS:
- 46       this
- 47           .addEventListener('mousemove', this.parent.rotateAxis.bind(this.parent, this, controlOri));
- 48       break;
- 49     case ROS3D.INTERACTIVE_MARKER_MOVE_PLANE:
- 50       this
- 51           .addEventListener('mousemove', this.parent.movePlane.bind(this.parent, this, controlAxis));
- 52       break;
- 53     case ROS3D.INTERACTIVE_MARKER_BUTTON:
- 54       this.addEventListener('click', this.parent.buttonClick.bind(this.parent, this));
- 55       break;
- 56     default:
- 57       break;
- 58   }
- 59 
- 60   /**
- 61    * Install default listeners for highlighting / dragging.
- 62    * 
- 63    * @param event - the event to stop
- 64    */
- 65   function stopPropagation(event) {
- 66     event.stopPropagation();
- 67   }
- 68 
- 69   // check the mode
- 70   if (message.interaction_mode != ROS3D.INTERACTIVE_MARKER_NONE) {
- 71     this.addEventListener('mousedown', this.parent.startDrag.bind(this.parent, this));
- 72     this.addEventListener('mouseup', this.parent.stopDrag.bind(this.parent, this));
- 73     this.addEventListener('contextmenu', this.parent.showMenu.bind(this.parent, this));
- 74     this.addEventListener('mouseover', stopPropagation);
- 75     this.addEventListener('mouseout', stopPropagation);
- 76     this.addEventListener('click', stopPropagation);
- 77 
- 78     // touch support
- 79     this.addEventListener('touchstart', function(event3d) {
- 80       console.log(event3d.domEvent);
- 81       if (event3d.domEvent.touches.length == 1) {
- 82         event3d.type = 'mousedown';
- 83         event3d.domEvent.button = 0;
- 84         that.dispatchEvent(event3d);
- 85       }
- 86     });
- 87     this.addEventListener('touchmove', function(event3d) {
- 88       if (event3d.domEvent.touches.length == 1) {
- 89         console.log(event3d.domEvent);
- 90         event3d.type = 'mousemove';
- 91         event3d.domEvent.button = 0;
- 92         that.dispatchEvent(event3d);
- 93       }
- 94     });
- 95     this.addEventListener('touchend', function(event3d) {
- 96       if (event3d.domEvent.touches.length == 0) {
- 97         event3d.domEvent.button = 0;
- 98         event3d.type = 'mouseup';
- 99         that.dispatchEvent(event3d);
-100         event3d.type = 'click';
-101         that.dispatchEvent(event3d);
-102       }
-103     });
-104   }
-105 
-106   // rotation behavior
-107   var rotInv = new THREE.Quaternion();
-108   var posInv = this.parent.position.clone().multiplyScalar(-1);
-109   switch (message.orientation_mode) {
-110     case ROS3D.INTERACTIVE_MARKER_INHERIT:
-111       rotInv = this.parent.quaternion.clone().inverse();
-112       this.updateMatrixWorld = function(force) {
-113         ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force);
-114         that.currentControlOri.copy(that.quaternion);
-115         that.currentControlOri.normalize();
-116       };
-117       break;
-118     case ROS3D.INTERACTIVE_MARKER_FIXED:
-119       this.updateMatrixWorld = function(force) {
-120         that.useQuaternion = true;
-121         that.quaternion = that.parent.quaternion.clone().inverse();
-122         that.updateMatrix();
-123         that.matrixWorldNeedsUpdate = true;
-124         ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force);
-125         that.currentControlOri.copy(that.quaternion);
-126       };
-127       break;
-128     case ROS3D.INTERACTIVE_MARKER_VIEW_FACING:
-129       var independentMarkerOrientation = message.independentMarkerOrientation;
-130       this.updateMatrixWorld = function(force) {
-131         that.camera.updateMatrixWorld();
-132         var cameraRot = new THREE.Matrix4().extractRotation(that.camera.matrixWorld);
-133 
-134         var ros2Gl = new THREE.Matrix4();
-135         var r90 = Math.PI * 0.5;
-136         var rv = new THREE.Vector3(-r90, 0, r90);
-137         ros2Gl.setRotationFromEuler(rv);
-138 
-139         var worldToLocal = new THREE.Matrix4();
-140         worldToLocal.getInverse(that.parent.matrixWorld);
-141 
-142         cameraRot.multiplyMatrices(cameraRot, ros2Gl);
-143         cameraRot.multiplyMatrices(worldToLocal, cameraRot);
-144 
-145         that.currentControlOri.setFromRotationMatrix(cameraRot);
-146 
-147         // check the orientation
-148         if (!independentMarkerOrientation) {
-149           that.useQuaternion = true;
-150           that.quaternion.copy(that.currentControlOri);
-151           that.updateMatrix();
-152           that.matrixWorldNeedsUpdate = true;
-153         }
-154         ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force);
-155       };
-156       break;
-157     default:
-158       console.error('Unkown orientation mode: ' + message.orientation_mode);
-159       break;
-160   }
-161 
-162   // create visuals (markers)
-163   message.markers.forEach(function(markerMsg) {
-164     var markerHelper = new ROS3D.Marker({
-165       message : markerMsg,
-166       path : that.path
-167     });
-168 
-169     if (markerMsg.header.frame_id !== '') {
-170       // if the marker lives in its own coordinate frame, convert position into IM's local frame
-171       markerHelper.position.add(posInv);
-172       markerHelper.position.applyQuaternion(rotInv);
-173       markerHelper.quaternion.multiplyQuaternions(rotInv, markerHelper.quaternion);
-174       markerHelper.updateMatrixWorld();
-175     }
-176 
-177     // add the marker
-178     that.add(markerHelper);
-179   });
-180 };
-181 ROS3D.InteractiveMarkerControl.prototype.__proto__ = THREE.Object3D.prototype;
-182 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerHandle.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerHandle.js.html deleted file mode 100644 index d685c36b..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerHandle.js.html +++ /dev/null @@ -1,180 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * Handle with signals for a single interactive marker.
-  7  *
-  8  * Emits the following events:
-  9  *  * 'pose' - emitted when a new pose comes from the server
- 10  *
- 11  * @constructor
- 12  * @param options - object with following keys:
- 13  *  * message - the interactive marker message
- 14  *  * feedbackTopic - the ROSLIB.Topic associated with the feedback
- 15  *  * tfClient - a handle to the TF client to use
- 16  */
- 17 ROS3D.InteractiveMarkerHandle = function(options) {
- 18   var options = options || {};
- 19   this.message = options.message;
- 20   this.feedbackTopic = options.feedbackTopic;
- 21   this.tfClient = options.tfClient;
- 22   this.name = this.message.name;
- 23   this.header = this.message.header;
- 24   this.controls = this.message.controls;
- 25   this.menuEntries = this.message.menu_entries;
- 26   this.dragging = false;
- 27   this.timeoutHandle = null;
- 28   this.tfTransform = new ROSLIB.Transform();
- 29   this.pose = new ROSLIB.Pose();
- 30 
- 31   // start by setting the pose
- 32   this.setPoseFromServer(this.message.pose);
- 33 };
- 34 ROS3D.InteractiveMarkerHandle.prototype.__proto__ = EventEmitter2.prototype;
- 35 
- 36 /**
- 37  * Subscribe to the TF associated with this interactive marker.
- 38  */
- 39 ROS3D.InteractiveMarkerHandle.prototype.subscribeTf = function() {
- 40   // subscribe to tf updates if frame-fixed
- 41   if (this.message.header.stamp.secs === 0.0 && this.message.header.stamp.nsecs === 0.0) {
- 42     this.tfClient.subscribe(this.message.header.frame_id, this.tfUpdate.bind(this));
- 43   }
- 44 };
- 45 
- 46 /**
- 47  * Emit the new pose that has come from the server.
- 48  */
- 49 ROS3D.InteractiveMarkerHandle.prototype.emitServerPoseUpdate = function() {
- 50   var poseTransformed = new ROSLIB.Pose(this.pose);
- 51   poseTransformed.applyTransform(this.tfTransform);
- 52   this.emit('pose', poseTransformed);
- 53 };
- 54 
- 55 /**
- 56  * Update the pose based on the pose given by the server.
- 57  * 
- 58  * @param poseMsg - the pose given by the server
- 59  */
- 60 ROS3D.InteractiveMarkerHandle.prototype.setPoseFromServer = function(poseMsg) {
- 61   this.pose = new ROSLIB.Pose(poseMsg);
- 62   this.emitServerPoseUpdate();
- 63 };
- 64 
- 65 /**
- 66  * Update the pose based on the TF given by the server.
- 67  * 
- 68  * @param transformMsg - the TF given by the server
- 69  */
- 70 ROS3D.InteractiveMarkerHandle.prototype.tfUpdate = function(transformMsg) {
- 71   this.tfTransform = new ROSLIB.Transform(transformMsg);
- 72   this.emitServerPoseUpdate();
- 73 };
- 74 
- 75 /**
- 76  * Set the pose from the client based on the given event.
- 77  * 
- 78  * @param event - the event to base the change off of
- 79  */
- 80 ROS3D.InteractiveMarkerHandle.prototype.setPoseFromClient = function(event) {
- 81   // apply the transform
- 82   this.pose = new ROSLIB.Pose(event);
- 83   var inv = this.tfTransform.clone();
- 84   inv.rotation.invert();
- 85   this.pose.applyTransform(inv);
- 86 
- 87   // send feedback to the server
- 88   this.sendFeedback(ROS3D.INTERACTIVE_MARKER_POSE_UPDATE, undefined, 0, event.controlName);
- 89 
- 90   // keep sending pose feedback until the mouse goes up
- 91   if (this.dragging) {
- 92     if (this.timeoutHandle) {
- 93       clearTimeout(this.timeoutHandle);
- 94     }
- 95     this.timeoutHandle = setTimeout(this.setPoseFromClient.bind(this, event), 250);
- 96   }
- 97 };
- 98 
- 99 /**
-100  * Send the button click feedback to the server.
-101  * 
-102  * @param event - the event associated with the button click
-103  */
-104 ROS3D.InteractiveMarkerHandle.prototype.onButtonClick = function(event) {
-105   this.sendFeedback(ROS3D.INTERACTIVE_MARKER_BUTTON_CLICK, event.clickPosition, 0,
-106       event.controlName);
-107 };
-108 
-109 /**
-110  * Send the mousedown feedback to the server.
-111  * 
-112  * @param event - the event associated with the mousedown
-113  */
-114 ROS3D.InteractiveMarkerHandle.prototype.onMouseDown = function(event) {
-115   this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_DOWN, event.clickPosition, 0, event.controlName);
-116   this.dragging = true;
-117 };
-118 
-119 /**
-120  * Send the mouseup feedback to the server.
-121  * 
-122  * @param event - the event associated with the mouseup
-123  */
-124 ROS3D.InteractiveMarkerHandle.prototype.onMouseUp = function(event) {
-125   this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MOUSE_UP, event.clickPosition, 0, event.controlName);
-126   this.dragging = false;
-127   if (this.timeoutHandle) {
-128     clearTimeout(this.timeoutHandle);
-129   }
-130 };
-131 
-132 /**
-133  * Send the menu select feedback to the server.
-134  * 
-135  * @param event - the event associated with the menu select
-136  */
-137 ROS3D.InteractiveMarkerHandle.prototype.onMenuSelect = function(event) {
-138   this.sendFeedback(ROS3D.INTERACTIVE_MARKER_MENU_SELECT, undefined, event.id, event.controlName);
-139 };
-140 
-141 /**
-142  * Send feedback to the interactive marker server.
-143  * 
-144  * @param eventType - the type of event that happened
-145  * @param clickPosition (optional) - the position in ROS space the click happened
-146  * @param menuEntryID (optional) - the menu entry ID that is associated
-147  * @param controlName - the name of the control
-148  */
-149 ROS3D.InteractiveMarkerHandle.prototype.sendFeedback = function(eventType, clickPosition,
-150     menuEntryID, controlName) {
-151 
-152   // check for the click position
-153   var mousePointValid = clickPosition !== undefined;
-154   var clickPosition = clickPosition || {
-155     x : 0,
-156     y : 0,
-157     z : 0
-158   };
-159 
-160   var feedback = {
-161     header : this.header,
-162     client_id : this.clientID,
-163     marker_name : this.name,
-164     control_name : controlName,
-165     event_type : eventType,
-166     pose : this.pose,
-167     mouse_point : clickPosition,
-168     mouse_point_valid : mousePointValid,
-169     menu_entry_id : menuEntryID
-170   };
-171   this.feedbackTopic.publish(feedback);
-172 };
-173 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerMenu.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerMenu.js.html deleted file mode 100644 index de587e28..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_interactivemarkers_InteractiveMarkerMenu.js.html +++ /dev/null @@ -1,175 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * A menu for an interactive marker. This will be overlayed on the canvas.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *  * menuEntries - the menu entries to add
- 11  *  * className (optional) - a custom CSS class for the menu div
- 12  *  * entryClassName (optional) - a custom CSS class for the menu entry
- 13  *  * overlayClassName (optional) - a  custom CSS class for the menu overlay
- 14  */
- 15 ROS3D.InteractiveMarkerMenu = function(options) {
- 16   var that = this;
- 17   var options = options || {};
- 18   var menuEntries = options.menuEntries;
- 19   var className = options.className || 'default-interactive-marker-menu';
- 20   var entryClassName = options.entryClassName || 'default-interactive-marker-menu-entry';
- 21   var overlayClassName = options.overlayClassName || 'default-interactive-marker-overlay';
- 22 
- 23   // holds the menu tree
- 24   var allMenus = [];
- 25   allMenus[0] = {
- 26     children : []
- 27   };
- 28 
- 29   THREE.EventDispatcher.call(this);
- 30 
- 31   // create the CSS for this marker if it has not been created
- 32   if (document.getElementById('default-interactive-marker-menu-css') === null) {
- 33     var style = document.createElement('style');
- 34     style.id = 'default-interactive-marker-menu-css';
- 35     style.type = 'text/css';
- 36     style.innerHTML = '.default-interactive-marker-menu {' + 'background-color: #444444;'
- 37         + 'border: 1px solid #888888;' + 'border: 1px solid #888888;' + 'padding: 0px 0px 0px 0px;'
- 38         + 'color: #FFFFFF;' + 'font-family: sans-serif;' + 'font-size: 0.8em;' + 'z-index: 1002;'
- 39         + '}' + '.default-interactive-marker-menu ul {' + 'padding: 0px 0px 5px 0px;'
- 40         + 'margin: 0px;' + 'list-style-type: none;' + '}'
- 41         + '.default-interactive-marker-menu ul li div {' + '-webkit-touch-callout: none;'
- 42         + '-webkit-user-select: none;' + '-khtml-user-select: none;' + '-moz-user-select: none;'
- 43         + '-ms-user-select: none;' + 'user-select: none;' + 'cursor: default;'
- 44         + 'padding: 3px 10px 3px 10px;' + '}' + '.default-interactive-marker-menu-entry:hover {'
- 45         + '  background-color: #666666;' + '  cursor: pointer;' + '}'
- 46         + '.default-interactive-marker-menu ul ul {' + '  font-style: italic;'
- 47         + '  padding-left: 10px;' + '}' + '.default-interactive-marker-overlay {'
- 48         + '  position: absolute;' + '  top: 0%;' + '  left: 0%;' + '  width: 100%;'
- 49         + '  height: 100%;' + '  background-color: black;' + '  z-index: 1001;'
- 50         + '  -moz-opacity: 0.0;' + '  opacity: .0;' + '  filter: alpha(opacity = 0);' + '}';
- 51     document.getElementsByTagName('head')[0].appendChild(style);
- 52   }
- 53 
- 54   // place the menu in a div
- 55   this.menuDomElem = document.createElement('div');
- 56   this.menuDomElem.style.position = 'absolute';
- 57   this.menuDomElem.className = className;
- 58   this.menuDomElem.addEventListener('contextmenu', function(event) {
- 59     event.preventDefault();
- 60   });
- 61 
- 62   // create the overlay DOM
- 63   this.overlayDomElem = document.createElement('div');
- 64   this.overlayDomElem.className = overlayClassName;
- 65 
- 66   this.hideListener = this.hide.bind(this);
- 67   this.overlayDomElem.addEventListener('contextmenu', this.hideListener);
- 68   this.overlayDomElem.addEventListener('click', this.hideListener);
- 69 
- 70   // parse all entries
- 71   for ( var i = 0; i < menuEntries.length; i++) {
- 72     var entry = menuEntries[i];
- 73     var id = entry.id;
- 74     allMenus[id] = {
- 75       title : entry.title,
- 76       id : id,
- 77       children : []
- 78     };
- 79   }
- 80 
- 81   // link children to parents
- 82   for ( var i = 0; i < menuEntries.length; i++) {
- 83     var entry = menuEntries[i];
- 84     var id = entry.id;
- 85     var menu = allMenus[id];
- 86     var parent = allMenus[entry.parent_id];
- 87     parent.children.push(menu);
- 88   }
- 89 
- 90   function emitMenuSelect(menuEntry, domEvent) {
- 91     this.dispatchEvent({
- 92       type : 'menu-select',
- 93       domEvent : domEvent,
- 94       id : menuEntry.id,
- 95       controlName : this.controlName
- 96     });
- 97     this.hide(domEvent);
- 98   }
- 99 
-100   /**
-101    * Create the HTML UL element for the menu and link it to the parent.
-102    * 
-103    * @param parentDomElem - the parent DOM element
-104    * @param parentMenu - the parent menu
-105    */
-106   function makeUl(parentDomElem, parentMenu) {
-107 
-108     var ulElem = document.createElement('ul');
-109     parentDomElem.appendChild(ulElem);
-110 
-111     var children = parentMenu.children;
-112 
-113     for ( var i = 0; i < children.length; i++) {
-114       var liElem = document.createElement('li');
-115       var divElem = document.createElement('div');
-116       divElem.appendChild(document.createTextNode(children[i].title));
-117       ulElem.appendChild(liElem);
-118       liElem.appendChild(divElem);
-119 
-120       if (children[i].children.length > 0) {
-121         makeUl(liElem, children[i]);
-122         divElem.addEventListener('click', that.hide.bind(that));
-123       } else {
-124         divElem.addEventListener('click', emitMenuSelect.bind(that, children[i]));
-125         divElem.className = 'default-interactive-marker-menu-entry';
-126       }
-127     }
-128 
-129   }
-130 
-131   // construct DOM element
-132   makeUl(this.menuDomElem, allMenus[0]);
-133 };
-134 
-135 /**
-136  * Shoe the menu DOM element.
-137  * 
-138  * @param control - the control for the menu
-139  * @param event - the event that caused this
-140  */
-141 ROS3D.InteractiveMarkerMenu.prototype.show = function(control, event) {
-142   if (event && event.preventDefault) {
-143     event.preventDefault();
-144   }
-145 
-146   this.controlName = control.name;
-147 
-148   // position it on the click
-149   this.menuDomElem.style.left = event.domEvent.clientX + 'px';
-150   this.menuDomElem.style.top = event.domEvent.clientY + 'px';
-151   document.body.appendChild(this.overlayDomElem);
-152   document.body.appendChild(this.menuDomElem);
-153 };
-154 
-155 /**
-156  * Hide the menu DOM element.
-157  * 
-158  * @param event (optional) - the event that caused this
-159  */
-160 ROS3D.InteractiveMarkerMenu.prototype.hide = function(event) {
-161   if (event && event.preventDefault) {
-162     event.preventDefault();
-163   }
-164 
-165   document.body.removeChild(this.overlayDomElem);
-166   document.body.removeChild(this.menuDomElem);
-167 };
-168 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGrid.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGrid.js.html deleted file mode 100644 index 4709c91b..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGrid.js.html +++ /dev/null @@ -1,67 +0,0 @@ -
  1 /**
-  2  * @author Russell Toris - rctoris@wpi.edu
-  3  */
-  4 
-  5 /**
-  6  * An OccupancyGrid can convert a ROS occupancy grid message into a THREE object.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *   * message - the occupancy grid message
- 11  */
- 12 ROS3D.OccupancyGrid = function(options) {
- 13   var options = options || {};
- 14   var message = options.message;
- 15 
- 16   // create the geometry
- 17   var width = message.info.width;
- 18   var height = message.info.height;
- 19   var geom = new THREE.PlaneGeometry(width, height);
- 20 
- 21   // create the color material
- 22   var dataColor = new Uint8Array(width * height * 3);
- 23   for ( var row = 0; row < height; row++) {
- 24     for ( var col = 0; col < width; col++) {
- 25       // determine the index into the map data
- 26       var mapI = col + ((height - row - 1) * width);
- 27       // determine the value
- 28       var data = message.data[mapI];
- 29       if (data === 100) {
- 30         var val = 0;
- 31       } else if (data === 0) {
- 32         var val = 255;
- 33       } else {
- 34         var val = 127;
- 35       }
- 36 
- 37       // determine the index into the image data array
- 38       var i = (col + (row * width)) * 3;
- 39       // r
- 40       dataColor[i] = val;
- 41       // g
- 42       dataColor[++i] = val;
- 43       // b
- 44       dataColor[++i] = val;
- 45     }
- 46   }
- 47   var texture = new THREE.DataTexture(dataColor, width, height, THREE.RGBFormat);
- 48   texture.needsUpdate = true;
- 49   var material = new THREE.MeshBasicMaterial({
- 50     map : texture
- 51   });
- 52   material.side = THREE.DoubleSide;
- 53 
- 54   // create the mesh
- 55   THREE.Mesh.call(this, geom, material);
- 56   this.scale.x = message.info.resolution;
- 57   this.scale.y = message.info.resolution;
- 58 };
- 59 ROS3D.OccupancyGrid.prototype.__proto__ = THREE.Mesh.prototype;
- 60 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGridClient.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGridClient.js.html deleted file mode 100644 index f8bee7c8..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_maps_OccupancyGridClient.js.html +++ /dev/null @@ -1,63 +0,0 @@ -
  1 /**
-  2  * @author Russell Toris - rctoris@wpi.edu
-  3  */
-  4 
-  5 /**
-  6  * An occupancy grid client that listens to a given map topic.
-  7  * 
-  8  * Emits the following events:
-  9  *  * 'change' - there was an update or change in the marker
- 10  *  
- 11  * @constructor
- 12  * @param options - object with following keys:
- 13  *   * ros - the ROSLIB.Ros connection handle
- 14  *   * topic (optional) - the map topic to listen to
- 15  *   * continuous (optional) - if the map should be continuously loaded (e.g., for SLAM)
- 16  *   * rootObject (optional) - the root object to add this marker to
- 17  */
- 18 ROS3D.OccupancyGridClient = function(options) {
- 19   var that = this;
- 20   var options = options || {};
- 21   var ros = options.ros;
- 22   var topic = options.topic || '/map';
- 23   this.continuous = options.continuous;
- 24   this.rootObject = options.rootObject || new THREE.Object3D();
- 25 
- 26   // current grid that is displayed
- 27   this.currentGrid = null;
- 28 
- 29   // subscribe to the topic
- 30   var rosTopic = new ROSLIB.Topic({
- 31     ros : ros,
- 32     name : topic,
- 33     messageType : 'nav_msgs/OccupancyGrid',
- 34     compression : 'png'
- 35   });
- 36   rosTopic.subscribe(function(message) {
- 37     // check for an old map
- 38     if (that.currentGrid) {
- 39       that.rootObject.remove(that.currentGrid);
- 40     }
- 41 
- 42     that.currentGrid = new ROS3D.OccupancyGrid({
- 43       message : message
- 44     });
- 45     that.rootObject.add(that.currentGrid);
- 46 
- 47     that.emit('change');
- 48     
- 49     // check if we should unsubscribe
- 50     if(!that.continuous) {
- 51       rosTopic.unsubscribe();
- 52     }
- 53   });
- 54 };
- 55 ROS3D.OccupancyGridClient.prototype.__proto__ = EventEmitter2.prototype;
- 56 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_Marker.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_Marker.js.html deleted file mode 100644 index a386a77a..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_Marker.js.html +++ /dev/null @@ -1,197 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  * @author Russell Toris - rctoris@wpi.edu
-  4  */
-  5 
-  6 /**
-  7  * A Marker can convert a ROS marker message into a THREE object.
-  8  *
-  9  * @constructor
- 10  * @param options - object with following keys:
- 11  *   * path - the base path or URL for any mesh files that will be loaded for this marker
- 12  *   * message - the marker message
- 13  */
- 14 ROS3D.Marker = function(options) {
- 15   var options = options || {};
- 16   var path = options.path || '/';
- 17   var message = options.message;
- 18 
- 19   // check for a trailing '/'
- 20   if (path.substr(path.length - 1) !== '/') {
- 21     path += '/';
- 22   }
- 23 
- 24   THREE.Object3D.call(this);
- 25   this.useQuaternion = true;
- 26 
- 27   // set the pose and get the color
- 28   this.setPose(message.pose);
- 29   var colorMaterial = ROS3D.makeColorMaterial(message.color.r, message.color.g, message.color.b,
- 30       message.color.a);
- 31 
- 32   // create the object based on the type
- 33   switch (message.type) {
- 34     case ROS3D.MARKER_ARROW:
- 35       // get the sizes for the arrow
- 36       var len = message.scale.x;
- 37       var headLength = len * 0.23;
- 38       var headDiameter = message.scale.y;
- 39       var shaftDiameter = headDiameter * 0.5;
- 40 
- 41       // determine the points
- 42       if (message.points.length === 2) {
- 43         var p1 = new THREE.Vector3(message.points[0].x, message.points[0].y, message.points[0].z);
- 44         var p2 = new THREE.Vector3(message.points[1].x, message.points[1].y, message.points[1].z);
- 45         var direction = p1.clone().negate().add(p2);
- 46         // direction = p2 - p1;
- 47         len = direction.length();
- 48         headDiameter = message.scale.y;
- 49         shaftDiameter = message.scale.x;
- 50 
- 51         if (message.scale.z !== 0.0) {
- 52           headLength = message.scale.z;
- 53         }
- 54       }
- 55 
- 56       // add the marker
- 57       this.add(new ROS3D.Arrow({
- 58         direction : direction,
- 59         origin : p1,
- 60         length : len,
- 61         headLength : headLength,
- 62         shaftDiameter : shaftDiameter,
- 63         headDiameter : headDiameter,
- 64         material : colorMaterial
- 65       }));
- 66       break;
- 67     case ROS3D.MARKER_CUBE:
- 68       // set the cube dimensions
- 69       var geom = new THREE.CubeGeometry(message.scale.x, message.scale.y, message.scale.z);
- 70       this.add(new THREE.Mesh(geom, colorMaterial));
- 71       break;
- 72     case ROS3D.MARKER_SPHERE:
- 73       // set the sphere dimensions
- 74       var geom = new THREE.SphereGeometry(0.5);
- 75       var mesh = new THREE.Mesh(geom, colorMaterial);
- 76       mesh.scale.x = message.scale.x;
- 77       mesh.scale.y = message.scale.y;
- 78       mesh.scale.z = message.scale.z;
- 79       this.add(mesh);
- 80       break;
- 81     case ROS3D.MARKER_CYLINDER:
- 82       // set the cylinder dimensions
- 83       var geom = new THREE.CylinderGeometry(0.5, 0.5, 1, 16, 1, false);
- 84       var mesh = new THREE.Mesh(geom, colorMaterial);
- 85       mesh.useQuaternion = true;
- 86       mesh.quaternion.setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI * 0.5);
- 87       mesh.scale = new THREE.Vector3(message.scale.x, message.scale.y, message.scale.z);
- 88       this.add(mesh);
- 89       break;
- 90     case ROS3D.MARKER_CUBE_LIST:
- 91     case ROS3D.MARKER_SPHERE_LIST:
- 92     case ROS3D.MARKER_POINTS:
- 93       // for now, use a particle system for the lists
- 94       var geometry = new THREE.Geometry();
- 95       var material = new THREE.ParticleBasicMaterial({
- 96         size : message.scale.x
- 97       });
- 98 
- 99       // add the points
-100       for ( var i = 0; i < message.points.length; i++) {
-101         var vertex = new THREE.Vector3();
-102         vertex.x = message.points[i].x;
-103         vertex.y = message.points[i].y;
-104         vertex.z = message.points[i].z;
-105         geometry.vertices.push(vertex);
-106       }
-107 
-108       // determine the colors for each
-109       if (message.colors.length === message.points.length) {
-110         material.vertexColors = true;
-111         for ( var i = 0; i < message.points.length; i++) {
-112           var color = new THREE.Color();
-113           color.setRGB(message.colors[i].r, message.colors[i].g, message.colors[i].b);
-114           geometry.colors.push(color);
-115         }
-116       } else {
-117         material.color.setRGB(message.color.r, message.color.g, message.color.b);
-118       }
-119 
-120       // add the particle system
-121       this.add(new THREE.ParticleSystem(geometry, material));
-122       break;
-123     case ROS3D.MARKER_TEXT_VIEW_FACING:
-124       // setup the text
-125       var textGeo = new THREE.TextGeometry(message.text, {
-126         size : message.scale.x * 0.5,
-127         height : 0.1 * message.scale.x,
-128         curveSegments : 4,
-129         font : 'helvetiker',
-130         bevelEnabled : false,
-131         bevelThickness : 2,
-132         bevelSize : 2,
-133         material : 0,
-134         extrudeMaterial : 0
-135       });
-136       textGeo.computeVertexNormals();
-137       textGeo.computeBoundingBox();
-138 
-139       // position the text and add it
-140       var mesh = new THREE.Mesh(textGeo, colorMaterial);
-141       var centerOffset = -0.5 * (textGeo.boundingBox.max.x - textGeo.boundingBox.min.x);
-142       mesh.position.y = -centerOffset;
-143       mesh.rotation.x = Math.PI * 0.5;
-144       mesh.rotation.y = Math.PI * 1.5;
-145       this.add(mesh);
-146       break;
-147     case ROS3D.MARKER_MESH_RESOURCE:
-148       // load and add the mesh
-149       this.add(new ROS3D.MeshResource({
-150         path : path,
-151         resource : message.mesh_resource.substr(10)
-152       }));
-153       break;
-154     case ROS3D.MARKER_TRIANGLE_LIST:
-155       // create the list of triangles
-156       var tri = new ROS3D.TriangleList({
-157         material : colorMaterial,
-158         vertices : message.points,
-159         colors : message.colors
-160       });
-161       tri.scale = new THREE.Vector3(message.scale.x, message.scale.y, message.scale.z);
-162       this.add(tri);
-163       break;
-164     default:
-165       console.error('Currently unsupported marker type: ' + message.type);
-166       break;
-167   }
-168 };
-169 ROS3D.Marker.prototype.__proto__ = THREE.Object3D.prototype;
-170 
-171 /**
-172  * Set the pose of this marker to the given values.
-173  * 
-174  * @param pose - the pose to set for this marker
-175  */
-176 ROS3D.Marker.prototype.setPose = function(pose) {
-177   // set position information
-178   this.position.x = pose.position.x;
-179   this.position.y = pose.position.y;
-180   this.position.z = pose.position.z;
-181 
-182   // set the rotation
-183   this.quaternion = new THREE.Quaternion(pose.orientation.x, pose.orientation.y,
-184       pose.orientation.z, pose.orientation.w);
-185   this.quaternion.normalize();
-186 
-187   // update the world
-188   this.updateMatrixWorld();
-189 };
-190 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_MarkerClient.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_MarkerClient.js.html deleted file mode 100644 index 2c1aa5cc..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_markers_MarkerClient.js.html +++ /dev/null @@ -1,63 +0,0 @@ -
  1 /**
-  2  * @author Russell Toris - rctoris@wpi.edu
-  3  */
-  4 
-  5 /**
-  6  * A marker client that listens to a given marker topic.
-  7  * 
-  8  * Emits the following events:
-  9  *  * 'change' - there was an update or change in the marker
- 10  *  
- 11  * @constructor
- 12  * @param options - object with following keys:
- 13  *   * ros - the ROSLIB.Ros connection handle
- 14  *   * topic - the marker topic to listen to
- 15  *   * tfClient - the TF client handle to use
- 16  *   * rootObject (optional) - the root object to add this marker to
- 17  */
- 18 ROS3D.MarkerClient = function(options) {
- 19   var that = this;
- 20   var options = options || {};
- 21   var ros = options.ros;
- 22   var topic = options.topic;
- 23   this.tfClient = options.tfClient;
- 24   this.rootObject = options.rootObject || new THREE.Object3D();
- 25 
- 26   // current marker that is displayed
- 27   this.currentMarker = null;
- 28 
- 29   // subscribe to the topic
- 30   var rosTopic = new ROSLIB.Topic({
- 31     ros : ros,
- 32     name : topic,
- 33     messageType : 'visualization_msgs/Marker',
- 34     compression : 'png'
- 35   });
- 36   rosTopic.subscribe(function(message) {
- 37     var newMarker = new ROS3D.Marker({
- 38       message : message
- 39     });
- 40     // check for an old marker
- 41     if (that.currentMarker) {
- 42       that.rootObject.remove(that.currentMarker);
- 43     }
- 44 
- 45     that.currentMarker = new ROS3D.SceneNode({
- 46       frameID : message.header.frame_id,
- 47       tfClient : that.tfClient,
- 48       object : newMarker
- 49     });
- 50     that.rootObject.add(that.currentMarker);
- 51     
- 52     that.emit('change');
- 53   });
- 54 };
- 55 ROS3D.MarkerClient.prototype.__proto__ = EventEmitter2.prototype;
- 56 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Arrow.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Arrow.js.html deleted file mode 100644 index 2c69e20a..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Arrow.js.html +++ /dev/null @@ -1,89 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * A Arrow is a THREE object that can be used to display an arrow model.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *   * origin (optional) - the origin of the arrow
- 11  *   * direction (optional) - the direction vector of the arrow
- 12  *   * length (optional) - the length of the arrow
- 13  *   * headLength (optional) - the head length of the arrow
- 14  *   * shaftDiameter (optional) - the shaft diameter of the arrow
- 15  *   * headDiameter (optional) - the head diameter of the arrow
- 16  *   * material (optional) - the material to use for this arrow
- 17  */
- 18 ROS3D.Arrow = function(options) {
- 19   var options = options || {};
- 20   var origin = options.origin || new THREE.Vector3(0, 0, 0);
- 21   var direction = options.direction || new THREE.Vector3(1, 0, 0);
- 22   var length = options.length || 1;
- 23   var headLength = options.headLength || 0.2;
- 24   var shaftDiameter = options.shaftDiameter || 0.05;
- 25   var headDiameter = options.headDiameter || 0.1;
- 26   var material = options.material || new THREE.MeshBasicMaterial();
- 27 
- 28   var shaftLength = length - headLength;
- 29 
- 30   // create and merge geometry
- 31   var geometry = new THREE.CylinderGeometry(shaftDiameter * 0.5, shaftDiameter * 0.5, shaftLength,
- 32       12, 1);
- 33   var m = new THREE.Matrix4();
- 34   m.setPosition(new THREE.Vector3(0, shaftLength * 0.5, 0));
- 35   geometry.applyMatrix(m);
- 36 
- 37   // create the head
- 38   var coneGeometry = new THREE.CylinderGeometry(0, headDiameter * 0.5, headLength, 12, 1);
- 39   m.setPosition(new THREE.Vector3(0, shaftLength + (headLength * 0.5), 0));
- 40   coneGeometry.applyMatrix(m);
- 41 
- 42   // put the arrow together
- 43   THREE.GeometryUtils.merge(geometry, coneGeometry);
- 44 
- 45   THREE.Mesh.call(this, geometry, material);
- 46 
- 47   this.position = origin;
- 48   this.setDirection(direction);
- 49 };
- 50 ROS3D.Arrow.prototype.__proto__ = THREE.Mesh.prototype;
- 51 
- 52 /**
- 53  * Set the direction of this arrow to that of the given vector.
- 54  * 
- 55  * @param direction - the direction to set this arrow
- 56  */
- 57 ROS3D.Arrow.prototype.setDirection = function(direction) {
- 58   var axis = new THREE.Vector3(0, 1, 0).cross(direction);
- 59   var radians = Math.acos(new THREE.Vector3(0, 1, 0).dot(direction.clone().normalize()));
- 60   this.matrix = new THREE.Matrix4().makeRotationAxis(axis.normalize(), radians);
- 61   this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder);
- 62 };
- 63 
- 64 /**
- 65  * Set this arrow to be the given length.
- 66  * 
- 67  * @param length - the new length of the arrow
- 68  */
- 69 ROS3D.Arrow.prototype.setLength = function(length) {
- 70   this.scale.set(length, length, length);
- 71 };
- 72 
- 73 /**
- 74  * Set the color of this arrow to the given hex value.
- 75  * 
- 76  * @param hex - the hex value of the color to use
- 77  */
- 78 ROS3D.Arrow.prototype.setColor = function(hex) {
- 79   this.line.material.color.setHex(hex);
- 80   this.cone.material.color.setHex(hex);
- 81 };
- 82 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Axes.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Axes.js.html deleted file mode 100644 index 1d24b612..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Axes.js.html +++ /dev/null @@ -1,78 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * An Axes object can be used to display the axis of a particular coordinate frame.
-  7  * 
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *   * shaftRadius (optional) - the radius of the shaft to render
- 11  *   * headRadius (optional) - the radius of the head to render 
- 12  *   * headLength (optional) - the length of the head to render
- 13  */
- 14 ROS3D.Axes = function(options) {
- 15   var that = this;
- 16   var options = options || {};
- 17   var shaftRadius = options.shaftRadius || 0.008;
- 18   var headRadius = options.headRadius || 0.023;
- 19   var headLength = options.headLength || 0.1;
- 20 
- 21   THREE.Object3D.call(this);
- 22 
- 23   // create the cylinders for the objects
- 24   this.lineGeom = new THREE.CylinderGeometry(shaftRadius, shaftRadius, 1.0 - headLength);
- 25   this.headGeom = new THREE.CylinderGeometry(0, headRadius, headLength);
- 26 
- 27   /**
- 28    * Adds an axis marker to this axes object.
- 29    * 
- 30    * @param axis - the 3D vector representing the axis to add
- 31    */
- 32   function addAxis(axis) {
- 33     // set the color of the axis
- 34     var color = new THREE.Color();
- 35     color.setRGB(axis.x, axis.y, axis.z);
- 36     var material = new THREE.MeshBasicMaterial({
- 37       color : color.getHex()
- 38     });
- 39 
- 40     // setup the rotation information
- 41     var rotAxis = new THREE.Vector3;
- 42     rotAxis.crossVectors(axis, new THREE.Vector3(0, -1, 0));
- 43     var rot = new THREE.Quaternion;
- 44     rot.setFromAxisAngle(rotAxis, 0.5 * Math.PI);
- 45 
- 46     // create the arrow
- 47     var arrow = new THREE.Mesh(that.headGeom, material);
- 48     arrow.position = axis.clone();
- 49     arrow.position.multiplyScalar(0.95);
- 50     arrow.useQuaternion = true;
- 51     arrow.quaternion = rot;
- 52     arrow.updateMatrix();
- 53     that.add(arrow);
- 54 
- 55     // create the line
- 56     var line = new THREE.Mesh(that.lineGeom, material);
- 57     line.position = axis.clone();
- 58     line.position.multiplyScalar(0.45);
- 59     line.useQuaternion = true;
- 60     line.quaternion = rot;
- 61     line.updateMatrix();
- 62     that.add(line);
- 63   };
- 64 
- 65   // add the three markers to the axes
- 66   addAxis(new THREE.Vector3(1, 0, 0));
- 67   addAxis(new THREE.Vector3(0, 1, 0));
- 68   addAxis(new THREE.Vector3(0, 0, 1));
- 69 };
- 70 ROS3D.Axes.prototype.__proto__ = THREE.Object3D.prototype;
- 71 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Grid.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Grid.js.html deleted file mode 100644 index 7e0d29b7..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_Grid.js.html +++ /dev/null @@ -1,37 +0,0 @@ -
  1 /**
-  2  * @author Russell Toris - rctoris@wpi.edu
-  3  */
-  4 
-  5 /**
-  6  * Create a grid object.
-  7  * 
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *  * size (optional) - the size of the grid
- 11  *  * color (optional) - the line color of the grid, like '#cccccc'
- 12  *  * lineWidth (optional) - the width of the lines in the grid
- 13  */
- 14 ROS3D.Grid = function(options) {
- 15   var options = options || {};
- 16   var size = options.size || 50;
- 17   var color = options.color || '#cccccc';
- 18   var lineWidth = options.lineWidth || 1;
- 19 
- 20   // create the mesh
- 21   THREE.Mesh.call(this, new THREE.PlaneGeometry(size, size, size, size),
- 22       new THREE.MeshBasicMaterial({
- 23         color : color,
- 24         wireframe : true,
- 25         wireframeLinewidth : lineWidth,
- 26         transparent : true
- 27       }));
- 28 };
- 29 ROS3D.Grid.prototype.__proto__ = THREE.Mesh.prototype;
- 30 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_MeshResource.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_MeshResource.js.html deleted file mode 100644 index 952b45d7..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_MeshResource.js.html +++ /dev/null @@ -1,54 +0,0 @@ -
  1 /**
-  2  * @author Jihoon Lee - jihoonlee.in@gmail.com
-  3  * @author Russell Toris - rctoris@wpi.edu
-  4  */
-  5 
-  6 /**
-  7  * A MeshResource is an THREE object that will load from a external mesh file. Currently loads
-  8  * Collada files.
-  9  * 
- 10  * @constructor
- 11  * @param options - object with following keys:
- 12  *  * path (optional) - the base path to the associated models that will be loaded
- 13  *  * resource - the resource file name to load
- 14  *  * warnings (optional) - if warnings should be printed
- 15  */
- 16 ROS3D.MeshResource = function(options) {
- 17   var that = this;
- 18   var options = options || {};
- 19   var path = options.path || '/';
- 20   var resource = options.resource;
- 21   this.warnings = options.warnings;
- 22 
- 23   THREE.Object3D.call(this);
- 24 
- 25   // check for a trailing '/'
- 26   if (path.substr(path.length - 1) !== '/') {
- 27     this.path += '/';
- 28   }
- 29 
- 30   var uri = path + resource;
- 31   var fileType = uri.substr(-4).toLowerCase();
- 32 
- 33   // check the type
- 34   if (uri.substr(-4).toLowerCase() === '.dae') {
- 35     var loader = new ColladaLoader2();
- 36     loader.log = function(message) {
- 37       if (that.warnings) {
- 38         console.warn(message);
- 39       }
- 40     };
- 41     loader.load(uri, function colladaReady(collada) {
- 42       that.add(collada.scene);
- 43     });
- 44   }
- 45 };
- 46 ROS3D.MeshResource.prototype.__proto__ = THREE.Object3D.prototype;
- 47 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_TriangleList.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_TriangleList.js.html deleted file mode 100644 index a9f7f421..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_models_TriangleList.js.html +++ /dev/null @@ -1,84 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * A TriangleList is a THREE object that can be used to display a list of triangles as a geometry.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *   * material (optional) - the material to use for the object
- 11  *   * vertices - the array of vertices to use
- 12  *   * colors - the associated array of colors to use
- 13  */
- 14 ROS3D.TriangleList = function(options) {
- 15   var options = options || {};
- 16   var material = options.material || new THREE.MeshBasicMaterial();
- 17   var vertices = options.vertices;
- 18   var colors = options.colors;
- 19 
- 20   THREE.Object3D.call(this);
- 21 
- 22   // set the material to be double sided
- 23   material.side = THREE.DoubleSide;
- 24 
- 25   // construct the geometry
- 26   var geometry = new THREE.Geometry();
- 27   for (i = 0; i < vertices.length; i++) {
- 28     geometry.vertices.push(new THREE.Vector3(vertices[i].x, vertices[i].y, vertices[i].z));
- 29   }
- 30 
- 31   // set the colors
- 32   if (colors.length === vertices.length) {
- 33     // use per-vertex color
- 34     for (i = 0; i < vertices.length; i += 3) {
- 35       var face = new THREE.Face3(i, i + 1, i + 2);
- 36       for (j = i * 3; j < i * 3 + 3; i++) {
- 37         var color = new THREE.Color();
- 38         color.setRGB(colors[i].r, colors[i].g, colors[i].b);
- 39         face.vertexColors.push(color);
- 40       }
- 41       geometry.faces.push(face);
- 42     }
- 43     material.vertexColors = THREE.VertexColors;
- 44   } else if (colors.length === vertices.length / 3) {
- 45     // use per-triangle color
- 46     for (i = 0; i < vertices.length; i += 3) {
- 47       var face = new THREE.Face3(i, i + 1, i + 2);
- 48       face.color.setRGB(colors[i / 3].r, colors[i / 3].g, colors[i / 3].b);
- 49       geometry.faces.push(face);
- 50     }
- 51     material.vertexColors = THREE.FaceColors;
- 52   } else {
- 53     // use marker color
- 54     for (i = 0; i < vertices.length; i += 3) {
- 55       var face = new THREE.Face3(i, i + 1, i + 2);
- 56       geometry.faces.push(face);
- 57     }
- 58   }
- 59 
- 60   geometry.computeBoundingBox();
- 61   geometry.computeBoundingSphere();
- 62   geometry.computeCentroids();
- 63   geometry.computeFaceNormals();
- 64 
- 65   this.add(new THREE.Mesh(geometry, material));
- 66 };
- 67 ROS3D.TriangleList.prototype.__proto__ = THREE.Object3D.prototype;
- 68 
- 69 /**
- 70  * Set the color of this object to the given hex value.
- 71  * 
- 72  * @param hex - the hex value of the color to set
- 73  */
- 74 ROS3D.TriangleList.prototype.setColor = function(hex) {
- 75   this.mesh.material.color.setHex(hex);
- 76 };
- 77 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_Urdf.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_Urdf.js.html deleted file mode 100644 index e5a4bb2f..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_Urdf.js.html +++ /dev/null @@ -1,60 +0,0 @@ -
  1 /**
-  2  * @author Jihoon Lee - jihoonlee.in@gmail.com
-  3  * @author Russell Toris - rctoris@wpi.edu
-  4  */
-  5 
-  6 /**
-  7  * A URDF can be used to load a ROSLIB.UrdfModel and its associated models into a 3D object.
-  8  *  
-  9  * @constructor
- 10  * @param options - object with following keys:
- 11  *   * urdfModel - the ROSLIB.UrdfModel to load
- 12  *   * tfClient - the TF client handle to use
- 13  *   * path (optional) - the base path to the associated Collada models that will be loaded
- 14  */
- 15 ROS3D.Urdf = function(options) {
- 16   var options = options || {};
- 17   var urdfModel = options.urdfModel;
- 18   var path = options.path || '/';
- 19   var tfClient = options.tfClient;
- 20 
- 21   THREE.Object3D.call(this);
- 22   this.useQuaternion = true;
- 23 
- 24   // load all models
- 25   var links = urdfModel.links;
- 26   for ( var l in links) {
- 27     var link = links[l];
- 28     if (link.visual && link.visual.geometry) {
- 29       if (link.visual.geometry.type === ROSLIB.URDF_MESH) {
- 30         var frameID = '/' + link.name;
- 31         var uri = link.visual.geometry.filename;
- 32         var fileType = uri.substr(-4).toLowerCase();
- 33 
- 34         // ignore mesh files which are not in Collada format
- 35         if (fileType === '.dae') {
- 36           // create a scene node with the model
- 37           var sceneNode = new ROS3D.SceneNode({
- 38             frameID : frameID,
- 39             pose : link.visual.origin,
- 40             tfClient : tfClient,
- 41             object : new ROS3D.MeshResource({
- 42               path : path,
- 43               resource : uri.substring(10)
- 44             })
- 45           });
- 46           this.add(sceneNode);
- 47         }
- 48       }
- 49     }
- 50   }
- 51 };
- 52 ROS3D.Urdf.prototype.__proto__ = THREE.Object3D.prototype;
- 53 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_UrdfClient.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_UrdfClient.js.html deleted file mode 100644 index 2b5df4a6..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_urdf_UrdfClient.js.html +++ /dev/null @@ -1,56 +0,0 @@ -
  1 /**
-  2  * @author Jihoon Lee - jihoonlee.in@gmail.com
-  3  * @author Russell Toris - rctoris@wpi.edu
-  4  */
-  5 
-  6 /**
-  7  * A URDF client can be used to load a URDF and its associated models into a 3D object from the ROS
-  8  * parameter server.
-  9  *
- 10  * Emits the following events:
- 11  * * 'change' - emited after the URDF and its meshes have been loaded into the root object
- 12  * 
- 13  * @constructor
- 14  * @param options - object with following keys:
- 15  *   * ros - the ROSLIB.Ros connection handle
- 16  *   * param (optional) - the paramter to load the URDF from, like 'robot_description'
- 17  *   * tfClient - the TF client handle to use
- 18  *   * path (optional) - the base path to the associated Collada models that will be loaded
- 19  *   * rootObject (optional) - the root object to add this marker to
- 20  */
- 21 ROS3D.UrdfClient = function(options) {
- 22   var that = this;
- 23   var options = options || {};
- 24   var ros = options.ros;
- 25   var param = options.param || 'robot_description';
- 26   this.path = options.path || '/';
- 27   this.tfClient = options.tfClient;
- 28   this.rootObject = options.rootObject || new THREE.Object3D();
- 29 
- 30   // get the URDF value from ROS
- 31   var getParam = new ROSLIB.Param({
- 32     ros : ros,
- 33     name : param
- 34   });
- 35   getParam.get(function(string) {
- 36     // hand off the XML string to the URDF model
- 37     var urdfModel = new ROSLIB.UrdfModel({
- 38       string : string
- 39     });
- 40 
- 41     // load all models
- 42     that.rootObject.add(new ROS3D.Urdf({
- 43       urdfModel : urdfModel,
- 44       path : that.path,
- 45       tfClient : that.tfClient
- 46     }));
- 47   });
- 48 };
- 49 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_SceneNode.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_SceneNode.js.html deleted file mode 100644 index 28debf07..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_SceneNode.js.html +++ /dev/null @@ -1,55 +0,0 @@ -
  1 /**
-  2  * @author Jihoon Lee - jihoonlee.in@gmail.com
-  3  * @author Russell Toris - rctoris@wpi.edu
-  4  */
-  5 
-  6 /**
-  7  * A SceneNode can be used to keep track of a 3D object with respect to a ROS frame within a scene.
-  8  *
-  9  * @constructor
- 10  * @param options - object with following keys:
- 11  *  * tfClient - a handle to the TF client
- 12  *  * frameID - the frame ID this object belongs to
- 13  *  * pose (optional) - the pose associated with this object
- 14  *  * object - the THREE 3D object to be rendered
- 15  */
- 16 ROS3D.SceneNode = function(options) {
- 17   var options = options || {};
- 18   var that = this;
- 19   var tfClient = options.tfClient;
- 20   var frameID = options.frameID;
- 21   var object = options.object;
- 22   this.pose = options.pose || new ROSLIB.Pose();
- 23 
- 24   THREE.Object3D.call(this);
- 25   this.useQuaternion = true;
- 26 
- 27   // add the model
- 28   this.add(object);
- 29 
- 30   // listen for TF updates
- 31   tfClient.subscribe(frameID,
- 32       function(msg) {
- 33         // apply the transform
- 34         var tf = new ROSLIB.Transform(msg);
- 35         var poseTransformed = new ROSLIB.Pose(that.pose);
- 36         poseTransformed.applyTransform(tf);
- 37 
- 38         // update the world
- 39         that.position.x = poseTransformed.position.x;
- 40         that.position.y = poseTransformed.position.y;
- 41         that.position.z = poseTransformed.position.z;
- 42         that.quaternion = new THREE.Quaternion(poseTransformed.orientation.x,
- 43             poseTransformed.orientation.y, poseTransformed.orientation.z,
- 44             poseTransformed.orientation.w);
- 45         that.updateMatrixWorld(true);
- 46       });
- 47 };
- 48 ROS3D.SceneNode.prototype.__proto__ = THREE.Object3D.prototype;
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_Viewer.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_Viewer.js.html deleted file mode 100644 index 0db151a4..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_Viewer.js.html +++ /dev/null @@ -1,123 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  * @author Russell Toris - rctoris@wpi.edu
-  4  * @author Jihoon Lee - jihoonlee.in@gmail.com
-  5  */
-  6 
-  7 /**
-  8  * A Viewer can be used to render an interactive 3D scene to a HTML5 canvas.
-  9  *
- 10  * @constructor
- 11  * @param options - object with following keys:
- 12  *  * divID - the ID of the div to place the viewer in
- 13  *  * width - the initial width, in pixels, of the canvas
- 14  *  * height - the initial height, in pixels, of the canvas
- 15  *  * background (optional) - the color to render the background, like '#efefef'
- 16  *  * antialias (optional) - if antialiasing should be used
- 17  *  * intensity (optional) - the lighting intensity setting to use
- 18  */
- 19 ROS3D.Viewer = function(options) {
- 20   var that = this;
- 21   var options = options || {};
- 22   var divID = options.divID;
- 23   var width = options.width;
- 24   var height = options.height;
- 25   var background = options.background || '#111111';
- 26   var antialias = options.antialias;
- 27   var intensity = options.intensity || 0.66;
- 28 
- 29   // create the canvas to render to
- 30   this.renderer = new THREE.WebGLRenderer({
- 31     antialias : this.antialias
- 32   });
- 33   this.renderer.setClearColorHex(background.replace('#', '0x'), 1.0);
- 34   this.renderer.sortObjects = false;
- 35   this.renderer.setSize(width, height);
- 36   this.renderer.shadowMapEnabled = false;
- 37   this.renderer.autoClear = false;
- 38 
- 39   // create the global scene
- 40   this.scene = new THREE.Scene();
- 41 
- 42   // create the global camera
- 43   this.camera = new THREE.PerspectiveCamera(40, width / height, 0.01, 1000);
- 44   this.camera.position.x = 3;
- 45   this.camera.position.y = 3;
- 46   this.camera.position.z = 3;
- 47   // add controls to the camera
- 48   this.cameraControls = new ROS3D.OrbitControls({
- 49     scene : this.scene,
- 50     camera : this.camera
- 51   });
- 52   this.cameraControls.userZoomSpeed = 0.5;
- 53 
- 54   // lights
- 55   this.scene.add(new THREE.AmbientLight(0x555555));
- 56   this.directionalLight = new THREE.DirectionalLight(0xffffff, intensity);
- 57   this.scene.add(this.directionalLight);
- 58 
- 59   // propagates mouse events to three.js objects
- 60   this.selectableObjects = new THREE.Object3D;
- 61   this.scene.add(this.selectableObjects);
- 62   var mouseHandler = new ROS3D.MouseHandler({
- 63     renderer : this.renderer,
- 64     camera : this.camera,
- 65     rootObject : this.selectableObjects,
- 66     fallbackTarget : this.cameraControls
- 67   });
- 68 
- 69   // highlights the receiver of mouse events
- 70   this.highlighter = new ROS3D.Highlighter({
- 71     mouseHandler : mouseHandler
- 72   });
- 73 
- 74   /**
- 75    * Renders the associated scene to the that.
- 76    */
- 77   function draw() {
- 78     // update the controls
- 79     that.cameraControls.update();
- 80 
- 81     // put light to the top-left of the camera
- 82     that.directionalLight.position = that.camera.localToWorld(new THREE.Vector3(-1, 1, 0));
- 83     that.directionalLight.position.normalize();
- 84 
- 85     // set the scene
- 86     that.renderer.clear(true, true, true);
- 87     that.renderer.render(that.scene, that.camera);
- 88 
- 89     // render any mouseovers
- 90     that.highlighter.renderHighlight(that.renderer, that.scene, that.camera);
- 91 
- 92     // draw the frame
- 93     requestAnimationFrame(draw);
- 94   };
- 95 
- 96   // add the renderer to the page
- 97   document.getElementById(divID).appendChild(this.renderer.domElement);
- 98 
- 99   // begin the animation
-100   draw();
-101 };
-102 
-103 /**
-104  * Add the given THREE Object3D to the global scene in the viewer.
-105  * 
-106  * @param object - the THREE Object3D to add
-107  * @param selectable (optional) - if the object should be added to the selectable list
-108  */
-109 ROS3D.Viewer.prototype.addObject = function(object, selectable) {
-110   if (selectable) {
-111     this.selectableObjects.add(object);
-112   } else {
-113     this.scene.add(object);
-114   }
-115 };
-116 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_Highlighter.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_Highlighter.js.html deleted file mode 100644 index 54d66fcd..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_Highlighter.js.html +++ /dev/null @@ -1,101 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * A mouseover highlighter for 3D objects in the scene.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *   * mouseHandler - the handler for the mouseover and mouseout events
- 11  */
- 12 ROS3D.Highlighter = function(options) {
- 13   var options = options || {};
- 14   var mouseHandler = options.mouseHandler;
- 15   this.hoverObjs = [];
- 16 
- 17   // bind the mouse events
- 18   mouseHandler.addEventListener('mouseover', this.onMouseOver.bind(this));
- 19   mouseHandler.addEventListener('mouseout', this.onMouseOut.bind(this));
- 20 };
- 21 
- 22 /**
- 23  * Add the current target of the mouseover to the hover list.
- 24  * @param event - the event that contains the target of the mouseover
- 25  */
- 26 ROS3D.Highlighter.prototype.onMouseOver = function(event) {
- 27   this.hoverObjs.push(event.currentTarget);
- 28 };
- 29 
- 30 /**
- 31  * Remove the current target of the mouseover from the hover list.
- 32  * @param event - the event that contains the target of the mouseout
- 33  */
- 34 ROS3D.Highlighter.prototype.onMouseOut = function(event) {
- 35   this.hoverObjs.splice(this.hoverObjs.indexOf(event.currentTarget), 1);
- 36 };
- 37 
- 38 /**
- 39  * Add all corresponding webgl objects in the given scene and add them to the given render list.
- 40  * 
- 41  * @param scene - the scene to check for webgl objects
- 42  * @param objects - the objects list to check
- 43  * @param renderList - the list to add to
- 44  */
- 45 ROS3D.Highlighter.prototype.getWebglObjects = function(scene, objects, renderList) {
- 46   var objlist = scene.__webglObjects;
- 47   // get corresponding webgl objects
- 48   for ( var c = 0; c < objects.length; c++) {
- 49     if (objects[c]) {
- 50       for ( var o = objlist.length - 1; o >= 0; o--) {
- 51         if (objlist[o].object === objects[c]) {
- 52           renderList.push(objlist[o]);
- 53           break;
- 54         }
- 55       }
- 56       // recurse into children
- 57       this.getWebglObjects(scene, objects[c].children, renderList);
- 58     }
- 59   }
- 60 };
- 61 
- 62 /**
- 63  * Render highlighted objects in the scene.
- 64  * 
- 65  * @param renderer - the renderer to use
- 66  * @param scene - the scene to use
- 67  * @param camera - the camera to use
- 68  */
- 69 ROS3D.Highlighter.prototype.renderHighlight = function(renderer, scene, camera) {
- 70   // get webgl objects
- 71   var renderList = [];
- 72   this.getWebglObjects(scene, this.hoverObjs, renderList);
- 73 
- 74   // define highlight material
- 75   scene.overrideMaterial = new THREE.MeshBasicMaterial({
- 76     fog : false,
- 77     opacity : 0.5,
- 78     depthTest : true,
- 79     depthWrite : false,
- 80     polygonOffset : true,
- 81     polygonOffsetUnits : -1,
- 82     side : THREE.DoubleSide
- 83   });;
- 84 
- 85   // swap render lists, render, undo
- 86   var oldWebglObjects = scene.__webglObjects;
- 87   scene.__webglObjects = renderList;
- 88 
- 89   renderer.render(scene, camera);
- 90 
- 91   scene.__webglObjects = oldWebglObjects;
- 92   scene.overrideMaterial = null;
- 93 };
- 94 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_MouseHandler.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_MouseHandler.js.html deleted file mode 100644 index e490d617..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_MouseHandler.js.html +++ /dev/null @@ -1,175 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  */
-  4 
-  5 /**
-  6  * A handler for mouse events within a 3D viewer.
-  7  *
-  8  * @constructor
-  9  * @param options - object with following keys:
- 10  *   * renderer - the main renderer
- 11  *   * camera - the main camera in the scene
- 12  *   * rootObject - the root object to check for mouse events
- 13  *   * fallbackTarget - the fallback target, e.g., the camera controls
- 14  */
- 15 ROS3D.MouseHandler = function(options) {
- 16   THREE.EventDispatcher.call(this);
- 17   this.renderer = options.renderer;
- 18   this.camera = options.camera;
- 19   this.rootObject = options.rootObject;
- 20   this.fallbackTarget = options.fallbackTarget;
- 21   this.lastTarget = this.fallbackTarget;
- 22   this.dragging = false;
- 23   this.projector = new THREE.Projector();
- 24 
- 25   // listen to DOM events
- 26   var eventNames = [ 'contextmenu', 'click', 'dblclick', 'mouseout', 'mousedown', 'mouseup',
- 27       'mousemove', 'mousewheel', 'DOMMouseScroll', 'touchstart', 'touchend', 'touchcancel',
- 28       'touchleave', 'touchmove' ];
- 29   this.listeners = {};
- 30 
- 31   // add event listeners for the associated mouse events
- 32   eventNames.forEach(function(eventName) {
- 33     this.listeners[eventName] = this.processDomEvent.bind(this);
- 34     this.renderer.domElement.addEventListener(eventName, this.listeners[eventName], false);
- 35   }, this);
- 36 };
- 37 
- 38 /**
- 39  * Process the particular DOM even that has occurred based on the mouse's position in the scene.
- 40  * 
- 41  * @param domEvent - the DOM event to process
- 42  */
- 43 ROS3D.MouseHandler.prototype.processDomEvent = function(domEvent) {
- 44   // don't deal with the default handler
- 45   domEvent.preventDefault();
- 46 
- 47   // compute normalized device coords and 3D mouse ray
- 48   var target = domEvent.target;
- 49   var rect = target.getBoundingClientRect();
- 50   var left = domEvent.clientX - rect.left - target.clientLeft + target.scrollLeft;
- 51   var top = domEvent.clientY - rect.top - target.clientTop + target.scrollTop;
- 52   var deviceX = left / target.clientWidth * 2 - 1;
- 53   var deviceY = -top / target.clientHeight * 2 + 1;
- 54   var vector = new THREE.Vector3(deviceX, deviceY, 0.5);
- 55   this.projector.unprojectVector(vector, this.camera);
- 56   // use the THREE raycaster
- 57   var mouseRaycaster = new THREE.Raycaster(this.camera.position.clone(), vector.sub(
- 58       this.camera.position).normalize());
- 59   var mouseRay = mouseRaycaster.ray;
- 60 
- 61   // make our 3d mouse event
- 62   var event3D = {
- 63     mousePos : new THREE.Vector2(deviceX, deviceY),
- 64     mouseRay : mouseRay,
- 65     domEvent : domEvent,
- 66     camera : this.camera,
- 67     intersection : this.lastIntersection
- 68   };
- 69 
- 70   // if the mouse leaves the dom element, stop everything
- 71   if (domEvent.type == 'mouseout') {
- 72     if (this.dragging) {
- 73       this.notify(this.lastTarget, 'mouseup', event3D);
- 74       this.dragging = false;
- 75     }
- 76     this.notify(this.lastTarget, 'mouseout', event3D);
- 77     this.lastTarget = null;
- 78     return;
- 79   }
- 80 
- 81   // while the user is holding the mouse down, stay on the same target
- 82   if (this.dragging) {
- 83     this.notify(this.lastTarget, domEvent.type, event3D);
- 84     // for check for right or left mouse button
- 85     if ((domEvent.type === 'mouseup' && domEvent.button === 2) || domEvent.type === 'click') {
- 86       this.dragging = false;
- 87     }
- 88     return;
- 89   }
- 90 
- 91   // in the normal case, we need to check what is under the mouse
- 92   var target = this.lastTarget;
- 93   var intersections = [];
- 94   intersections = mouseRaycaster.intersectObject(this.rootObject, true);
- 95   if (intersections.length > 0) {
- 96     target = intersections[0].object;
- 97     event3D.intersection = this.lastIntersection = intersections[0];
- 98   } else {
- 99     target = this.fallbackTarget;
-100   }
-101 
-102   // if the mouse moves from one object to another (or from/to the 'null' object), notify both
-103   if (target !== this.lastTarget) {
-104     var eventAccepted = this.notify(target, 'mouseover', event3D);
-105     if (eventAccepted) {
-106       this.notify(this.lastTarget, 'mouseout', event3D);
-107     } else {
-108       // if target was null or no target has caught our event, fall back
-109       target = this.fallbackTarget;
-110       if (target !== this.lastTarget) {
-111         this.notify(target, 'mouseover', event3D);
-112         this.notify(this.lastTarget, 'mouseout', event3D);
-113       }
-114     }
-115   }
-116 
-117   // pass through event
-118   this.notify(target, domEvent.type, event3D);
-119   if (domEvent.type === 'mousedown') {
-120     this.dragging = true;
-121   }
-122   this.lastTarget = target;
-123 };
-124 
-125 /**
-126  * Notify the listener of the type of event that occurred.
-127  * 
-128  * @param target - the target of the event
-129  * @param type - the type of event that occurred 
-130  * @param event3D - the 3D mouse even information
-131  * @returns if an event was canceled
-132  */
-133 ROS3D.MouseHandler.prototype.notify = function(target, type, event3D) {
-134   // ensure the type is set
-135   event3D.type = type;
-136 
-137   // make the event cancelable
-138   event3D.cancelBubble = false;
-139   event3D.stopPropagation = function() {
-140     event3D.cancelBubble = true;
-141   };
-142   // walk up graph until event is canceled or root node has been reached
-143   event3D.currentTarget = target;
-144   while (event3D.currentTarget) {
-145     // try to fire event on object
-146     if (event3D.currentTarget.dispatchEvent
-147         && event3D.currentTarget.dispatchEvent instanceof Function) {
-148       event3D.currentTarget.dispatchEvent(event3D);
-149       if (event3D.cancelBubble) {
-150         this.dispatchEvent(event3D);
-151         return true;
-152       }
-153     }
-154     // walk up
-155     event3D.currentTarget = event3D.currentTarget.parent;
-156   }
-157   return false;
-158 };
-159 
-160 /**
-161  * Destroy this mouse handler and its associated listeners.
-162  */
-163 ROS3D.MouseHandler.prototype.destroy = function() {
-164   this.listeners.forEach(function(listener) {
-165     this.renderer.domElement.removeEventListener(eventName, listener, false);
-166   }, this);
-167 };
-168 
\ No newline at end of file diff --git a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_OrbitControls.js.html b/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_OrbitControls.js.html deleted file mode 100644 index 5801a8b8..00000000 --- a/doc/symbols/src/_home_rctoris_Documents_WPI_RAIL_ROS_groovy_src_ros3djs_src_visualization_interaction_OrbitControls.js.html +++ /dev/null @@ -1,377 +0,0 @@ -
  1 /**
-  2  * @author David Gossow - dgossow@willowgarage.com
-  3  * @author Xueqiao Xu - xueqiaoxu@gmail.com
-  4  * @author Mr.doob - http://mrdoob.com
-  5  * @author AlteredQualia - http://alteredqualia.com
-  6  */
-  7 
-  8 /**
-  9  * Behaves like THREE.OrbitControls, but uses right-handed coordinates and z as up vector.
- 10  *
- 11  * @constructor
- 12  * @param scene - the global scene to use
- 13  * @param camera - the camera to use
- 14  * @param userZoomSpeed (optional) - the speed for zooming
- 15  * @param userRotateSpeed (optional) - the speed for rotating
- 16  * @param autoRotate (optional) - if the orbit should auto rotate
- 17  * @param autoRotate (optional) - the speed for auto rotating 
- 18  */
- 19 ROS3D.OrbitControls = function(options) {
- 20   THREE.EventDispatcher.call(this);
- 21   var that = this;
- 22   var options = options || {};
- 23   var scene = options.scene;
- 24   this.camera = options.camera;
- 25   this.center = new THREE.Vector3();
- 26   this.userZoom = true;
- 27   this.userZoomSpeed = options.userZoomSpeed || 1.0;
- 28   this.userRotate = true;
- 29   this.userRotateSpeed = options.userRotateSpeed || 1.0;
- 30   this.autoRotate = options.autoRotate;
- 31   this.autoRotateSpeed = options.autoRotateSpeed || 2.0;
- 32 
- 33   // In ROS, z is pointing upwards
- 34   this.camera.up = new THREE.Vector3(0, 0, 1);
- 35 
- 36   // internals
- 37   var pixlesPerRound = 1800;
- 38   var rotateStart = new THREE.Vector2();
- 39   var rotateEnd = new THREE.Vector2();
- 40   var rotateDelta = new THREE.Vector2();
- 41   var zoomStart = new THREE.Vector2();
- 42   var zoomEnd = new THREE.Vector2();
- 43   var zoomDelta = new THREE.Vector2();
- 44   var moveStartCenter = new THREE.Vector3();
- 45   var moveStartNormal = new THREE.Vector3();
- 46   var moveStartPosition = new THREE.Vector3();
- 47   var moveStartIntersection = new THREE.Vector3();
- 48   this.phiDelta = 0;
- 49   this.thetaDelta = 0;
- 50   this.scale = 1;
- 51   this.lastPosition = new THREE.Vector3();
- 52   // internal states
- 53   var STATE = {
- 54     NONE : -1,
- 55     ROTATE : 0,
- 56     ZOOM : 1,
- 57     MOVE : 2
- 58   };
- 59   var state = STATE.NONE;
- 60 
- 61   // add the axes for the main coordinate frame
- 62   this.axes = new ROS3D.Axes({
- 63     shaftRadius : 0.025,
- 64     headRadius : 0.07,
- 65     headLength : 0.2
- 66   });
- 67   // initially not visible
- 68   scene.add(this.axes);
- 69   this.axes.traverse(function(obj) {
- 70     obj.visible = false;
- 71   });
- 72 
- 73   /**
- 74    * Handle the mousedown 3D event.
- 75    * 
- 76    * @param event3D - the 3D event to handle
- 77    */
- 78   function onMouseDown(event3D) {
- 79     var event = event3D.domEvent;
- 80     event.preventDefault();
- 81 
- 82     switch (event.button) {
- 83       case 0:
- 84         state = STATE.ROTATE;
- 85         rotateStart.set(event.clientX, event.clientY);
- 86         break;
- 87       case 1:
- 88         state = STATE.MOVE;
- 89 
- 90         moveStartNormal = new THREE.Vector3(0, 0, 1);
- 91         var rMat = new THREE.Matrix4().extractRotation(this.camera.matrix);
- 92         // rMat.multiplyVector3( moveStartNormal );
- 93         moveStartNormal.applyMatrix4(rMat);
- 94 
- 95         moveStartCenter = that.center.clone();
- 96         moveStartPosition = that.camera.position.clone();
- 97         moveStartIntersection = ROS3D.intersectPlane(event3D.mouseRay, moveStartCenter,
- 98             moveStartNormal);
- 99         break;
-100       case 2:
-101         state = STATE.ZOOM;
-102         zoomStart.set(event.clientX, event.clientY);
-103         break;
-104     }
-105 
-106     this.showAxes();
-107   };
-108 
-109   /**
-110    * Handle the movemove 3D event.
-111    * 
-112    * @param event3D - the 3D event to handle
-113    */
-114   function onMouseMove(event3D) {
-115     var event = event3D.domEvent;
-116     if (state === STATE.ROTATE) {
-117 
-118       rotateEnd.set(event.clientX, event.clientY);
-119       rotateDelta.subVectors(rotateEnd, rotateStart);
-120 
-121       that.rotateLeft(2 * Math.PI * rotateDelta.x / pixlesPerRound * that.userRotateSpeed);
-122       that.rotateUp(2 * Math.PI * rotateDelta.y / pixlesPerRound * that.userRotateSpeed);
-123 
-124       rotateStart.copy(rotateEnd);
-125       this.showAxes();
-126     } else if (state === STATE.ZOOM) {
-127       zoomEnd.set(event.clientX, event.clientY);
-128       zoomDelta.subVectors(zoomEnd, zoomStart);
-129 
-130       if (zoomDelta.y > 0) {
-131         that.zoomIn();
-132       } else {
-133         that.zoomOut();
-134       }
-135 
-136       zoomStart.copy(zoomEnd);
-137       this.showAxes();
-138 
-139     } else if (state === STATE.MOVE) {
-140       var intersection = ROS3D.intersectPlane(event3D.mouseRay, that.center, moveStartNormal);
-141 
-142       if (!intersection) {
-143         return;
-144       }
-145 
-146       var delta = new THREE.Vector3().subVectors(moveStartIntersection.clone(), intersection
-147           .clone());
-148 
-149       that.center.addVectors(moveStartCenter.clone(), delta.clone());
-150       that.camera.position.addVectors(moveStartPosition.clone(), delta.clone());
-151       that.update();
-152       that.camera.updateMatrixWorld();
-153       this.showAxes();
-154     }
-155   };
-156 
-157   /**
-158    * Handle the mouseup 3D event.
-159    * 
-160    * @param event3D - the 3D event to handle
-161    */
-162   function onMouseUp(event3D) {
-163     if (!that.userRotate) {
-164       return;
-165     }
-166 
-167     state = STATE.NONE;
-168   };
-169 
-170   /**
-171    * Handle the mousewheel 3D event.
-172    * 
-173    * @param event3D - the 3D event to handle
-174    */
-175   function onMouseWheel(event3D) {
-176     if (!that.userZoom) {
-177       return;
-178     }
-179 
-180     var event = event3D.domEvent;
-181     // wheelDelta --> Chrome, detail --> Firefox
-182     if (typeof (event.wheelDelta) !== 'undefined') {
-183       var delta = event.wheelDelta;
-184     } else {
-185       var delta = -event.detail;
-186     }
-187     if (delta > 0) {
-188       that.zoomOut();
-189     } else {
-190       that.zoomIn();
-191     }
-192 
-193     this.showAxes();
-194   };
-195 
-196   /**
-197    * Handle the touchdown 3D event.
-198    * 
-199    * @param event3D - the 3D event to handle
-200    */
-201   function onTouchDown(event) {
-202     onMouseDown(event);
-203     event.preventDefault();
-204   };
-205 
-206   /**
-207    * Handle the touchmove 3D event.
-208    * 
-209    * @param event3D - the 3D event to handle
-210    */
-211   function onTouchMove(event) {
-212     onMouseMove(event);
-213     event.preventDefault();
-214   };
-215 
-216   // add event listeners
-217   this.addEventListener('mousedown', onMouseDown);
-218   this.addEventListener('mouseup', onMouseUp);
-219   this.addEventListener('mousemove', onMouseMove);
-220   this.addEventListener('touchstart', onTouchDown);
-221   this.addEventListener('touchmove', onTouchMove);
-222   // Chrome/Firefox have different events here
-223   this.addEventListener('mousewheel', onMouseWheel);
-224   this.addEventListener('DOMMouseScroll', onMouseWheel);
-225 };
-226 
-227 /**
-228  * Display the main axes for 1 second.
-229  */
-230 ROS3D.OrbitControls.prototype.showAxes = function() {
-231   var that = this;
-232 
-233   this.axes.traverse(function(obj) {
-234     obj.visible = true;
-235   });
-236   if (this.hideTimeout) {
-237     clearTimeout(this.hideTimeout);
-238   }
-239   this.hideTimeout = setTimeout(function() {
-240     that.axes.traverse(function(obj) {
-241       obj.visible = false;
-242     });
-243     that.hideTimeout = false;
-244   }, 1000);
-245 };
-246 
-247 /**
-248  * Rotate the camera to the left by the given angle.
-249  * 
-250  * @param angle (optional) - the angle to rotate by
-251  */
-252 ROS3D.OrbitControls.prototype.rotateLeft = function(angle) {
-253   if (angle === undefined) {
-254     angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
-255   }
-256   this.thetaDelta -= angle;
-257 };
-258 
-259 /**
-260  * Rotate the camera to the right by the given angle.
-261  * 
-262  * @param angle (optional) - the angle to rotate by
-263  */
-264 ROS3D.OrbitControls.prototype.rotateRight = function(angle) {
-265   if (angle === undefined) {
-266     angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
-267   }
-268   this.thetaDelta += angle;
-269 };
-270 
-271 /**
-272  * Rotate the camera up by the given angle.
-273  * 
-274  * @param angle (optional) - the angle to rotate by
-275  */
-276 ROS3D.OrbitControls.prototype.rotateUp = function(angle) {
-277   if (angle === undefined) {
-278     angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
-279   }
-280   this.phiDelta -= angle;
-281 };
-282 
-283 /**
-284  * Rotate the camera down by the given angle.
-285  * 
-286  * @param angle (optional) - the angle to rotate by
-287  */
-288 ROS3D.OrbitControls.prototype.rotateDown = function(angle) {
-289   if (angle === undefined) {
-290     angle = 2 * Math.PI / 60 / 60 * this.autoRotateSpeed;
-291   }
-292   this.phiDelta += angle;
-293 };
-294 
-295 /**
-296  * Zoom in by the given scale.
-297  * 
-298  * @param zoomScale (optional) - the scale to zoom in by
-299  */
-300 ROS3D.OrbitControls.prototype.zoomIn = function(zoomScale) {
-301   if (zoomScale === undefined) {
-302     zoomScale = Math.pow(0.95, this.userZoomSpeed);
-303   }
-304   this.scale /= zoomScale;
-305 };
-306 
-307 /**
-308  * Zoom out by the given scale.
-309  * 
-310  * @param zoomScale (optional) - the scale to zoom in by
-311  */
-312 ROS3D.OrbitControls.prototype.zoomOut = function(zoomScale) {
-313   if (zoomScale === undefined) {
-314     zoomScale = Math.pow(0.95, this.userZoomSpeed);
-315   }
-316   this.scale *= zoomScale;
-317 };
-318 
-319 /**
-320  * Update the camera to the current settings.
-321  */
-322 ROS3D.OrbitControls.prototype.update = function() {
-323   // x->y, y->z, z->x
-324   var position = this.camera.position;
-325   var offset = position.clone().sub(this.center);
-326 
-327   // angle from z-axis around y-axis
-328   var theta = Math.atan2(offset.y, offset.x);
-329 
-330   // angle from y-axis
-331   var phi = Math.atan2(Math.sqrt(offset.y * offset.y + offset.x * offset.x), offset.z);
-332 
-333   if (this.autoRotate) {
-334     this.rotateLeft(2 * Math.PI / 60 / 60 * this.autoRotateSpeed);
-335   }
-336 
-337   theta += this.thetaDelta;
-338   phi += this.phiDelta;
-339 
-340   // restrict phi to be betwee EPS and PI-EPS
-341   var eps = 0.000001;
-342   phi = Math.max(eps, Math.min(Math.PI - eps, phi));
-343 
-344   var radius = offset.length();
-345   offset.y = radius * Math.sin(phi) * Math.sin(theta);
-346   offset.z = radius * Math.cos(phi);
-347   offset.x = radius * Math.sin(phi) * Math.cos(theta);
-348   offset.multiplyScalar(this.scale);
-349 
-350   position.copy(this.center).add(offset);
-351 
-352   this.camera.lookAt(this.center);
-353 
-354   radius = offset.length();
-355   this.axes.position = this.center.clone();
-356   this.axes.scale.x = this.axes.scale.y = this.axes.scale.z = radius * 0.05;
-357   this.axes.updateMatrixWorld(true);
-358 
-359   this.thetaDelta = 0;
-360   this.phiDelta = 0;
-361   this.scale = 1;
-362 
-363   if (this.lastPosition.distanceTo(this.camera.position) > 0) {
-364     this.dispatchEvent({
-365       type : 'change'
-366     });
-367     this.lastPosition.copy(this.camera.position);
-368   }
-369 };
-370 
\ No newline at end of file From baf6c89f0c2f4f36775f8fe321407a25ca6adda4 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Mon, 15 Apr 2013 09:15:52 -0700 Subject: [PATCH 5/7] r5-devel started --- CHANGELOG.md | 2 ++ src/Ros3D.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd06935f..fbdbc15b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +DEVEL - **r5** + 2013-04-15 - **r4** * Initial pose now set in SceneNode [(rctoris)](https://github.com/rctoris/) * Texture method for OccupancyGrid changed to canvas to allow for very large maps [(rctoris)](https://github.com/rctoris/) diff --git a/src/Ros3D.js b/src/Ros3D.js index 6c9cd50a..01442452 100644 --- a/src/Ros3D.js +++ b/src/Ros3D.js @@ -4,7 +4,7 @@ */ var ROS3D = ROS3D || { - REVISION : '4' + REVISION : '5-devel' }; // Marker types From fadca1b3c4ce018ecba1812eda4dc18a94774ac6 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Mon, 15 Apr 2013 09:18:13 -0700 Subject: [PATCH 6/7] changelog bug fixed --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbdbc15b..177cf22b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ DEVEL - **r5** * Optional TF client added to occupancy grid client [(rctoris)](https://github.com/rctoris/) * Interactive markers now removed correctly [(rctoris)](https://github.com/rctoris/) * Viewer now takes an optional initial camera position [(rctoris)](https://github.com/rctoris/) - * Orbit controls fixed to prevent flicker during camera pan [(rctoris)](https://github.c + * Orbit controls fixed to prevent flicker during camera pan [(rctoris)](https://github.com/rctoris/) * Scale (units) now work in Collada files [(rctoris)](https://github.com/rctoris/)om/rctoris/) * Grunt files added and code cleanup for linter [(rctoris)](https://github.com/rctoris/) From 47206dd6da9b789a9dfc5784d475e756275a47e6 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Mon, 15 Apr 2013 09:19:07 -0700 Subject: [PATCH 7/7] changelog bug fixed --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 177cf22b..71877f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ DEVEL - **r5** * Interactive markers now removed correctly [(rctoris)](https://github.com/rctoris/) * Viewer now takes an optional initial camera position [(rctoris)](https://github.com/rctoris/) * Orbit controls fixed to prevent flicker during camera pan [(rctoris)](https://github.com/rctoris/) - * Scale (units) now work in Collada files [(rctoris)](https://github.com/rctoris/)om/rctoris/) + * Scale (units) now work in Collada files [(rctoris)](https://github.com/rctoris/) * Grunt files added and code cleanup for linter [(rctoris)](https://github.com/rctoris/) 2013-04-03 - **r3**