From 5f2bf7e39ac6209a0ea1102474e22ad3e61a77a5 Mon Sep 17 00:00:00 2001 From: David Lu Date: Tue, 14 Jul 2015 18:07:41 -0400 Subject: [PATCH 01/11] Path display --- src/navigation/Path.js | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/navigation/Path.js diff --git a/src/navigation/Path.js b/src/navigation/Path.js new file mode 100644 index 00000000..a95d4ce2 --- /dev/null +++ b/src/navigation/Path.js @@ -0,0 +1,64 @@ +/** + * @author David V. Lu!! - davidvlu@gmail.com + */ + +/** + * A Path client that listens to a given topic and displays a line connecting the poses. + * + * @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 + * * color (optional) - color for line (default: 0xcc00ff) + */ +ROS3D.Path = function(options) { + options = options || {}; + var ros = options.ros; + var topic = options.topic || '/path'; + this.tfClient = options.tfClient; + this.color = options.color || 0xcc00ff; + this.prev_pts = 0; + this.rootObject = options.rootObject || new THREE.Object3D(); + var that = this; + THREE.Object3D.call(this); + + this.sn = null; + this.line = null; + + var rosTopic = new ROSLIB.Topic({ + ros : ros, + name : topic, + messageType : 'nav_msgs/Path' + }); + + rosTopic.subscribe(function(message) { + if(that.sn!=null){ + that.rootObject.remove(that.sn); + } + + var lineGeometry = new THREE.Geometry(); + for(var i=0; i Date: Tue, 14 Jul 2015 18:49:48 -0400 Subject: [PATCH 02/11] Renaming folders --- src/{maps => navigation}/OccupancyGrid.js | 0 src/{maps => navigation}/OccupancyGridClient.js | 0 src/{pointcloud => sensors}/PointCloud2.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/{maps => navigation}/OccupancyGrid.js (100%) rename src/{maps => navigation}/OccupancyGridClient.js (100%) rename src/{pointcloud => sensors}/PointCloud2.js (100%) diff --git a/src/maps/OccupancyGrid.js b/src/navigation/OccupancyGrid.js similarity index 100% rename from src/maps/OccupancyGrid.js rename to src/navigation/OccupancyGrid.js diff --git a/src/maps/OccupancyGridClient.js b/src/navigation/OccupancyGridClient.js similarity index 100% rename from src/maps/OccupancyGridClient.js rename to src/navigation/OccupancyGridClient.js diff --git a/src/pointcloud/PointCloud2.js b/src/sensors/PointCloud2.js similarity index 100% rename from src/pointcloud/PointCloud2.js rename to src/sensors/PointCloud2.js From cbe3e127b6679d5bb3f5b22e43a31717459d07d8 Mon Sep 17 00:00:00 2001 From: David Lu Date: Wed, 15 Jul 2015 14:41:45 -0400 Subject: [PATCH 03/11] Path cleanup and remove unsub from PC2 --- src/navigation/Path.js | 11 +++++------ src/sensors/PointCloud2.js | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/navigation/Path.js b/src/navigation/Path.js index a95d4ce2..67bcecca 100644 --- a/src/navigation/Path.js +++ b/src/navigation/Path.js @@ -20,7 +20,6 @@ ROS3D.Path = function(options) { var topic = options.topic || '/path'; this.tfClient = options.tfClient; this.color = options.color || 0xcc00ff; - this.prev_pts = 0; this.rootObject = options.rootObject || new THREE.Object3D(); var that = this; THREE.Object3D.call(this); @@ -35,16 +34,16 @@ ROS3D.Path = function(options) { }); rosTopic.subscribe(function(message) { - if(that.sn!=null){ - that.rootObject.remove(that.sn); + if(that.sn!==null){ + that.rootObject.remove(that.sn); } - var lineGeometry = new THREE.Geometry(); + var lineGeometry = new THREE.Geometry(); for(var i=0; i Date: Wed, 15 Jul 2015 18:33:58 -0400 Subject: [PATCH 04/11] LaserScan --- src/sensors/LaserScan.js | 56 ++++++++++++++++++++++++++++++++++++++++ src/sensors/Particles.js | 6 ++--- 2 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 src/sensors/LaserScan.js diff --git a/src/sensors/LaserScan.js b/src/sensors/LaserScan.js new file mode 100644 index 00000000..2d45d028 --- /dev/null +++ b/src/sensors/LaserScan.js @@ -0,0 +1,56 @@ +/** + * @author David V. Lu!! - davidvlu@gmail.com + */ + +/** + * A LaserScan client that listens to a given topic and displays the points. + * + * @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 + * * color - (optional) color of the points (default 0xFFA500) + * * texture - (optional) Image url for a texture to use for the points. Defaults to a single white pixel. + * * rootObject (optional) - the root object to add this marker to + * * size (optional) - size to draw each point (default 0.05) + * * max_pts (optional) - number of points to draw (default 100) + */ +ROS3D.LaserScan = function(options) { + options = options || {}; + var ros = options.ros; + var topic = options.topic || '/scan'; + this.color = options.color || 0xFFA500; + console.log(this.color); + var that = this; + + this.particles = new ROS3D.Particles(options); + + var rosTopic = new ROSLIB.Topic({ + ros : ros, + name : topic, + messageType : 'sensor_msgs/LaserScan' + }); + + + rosTopic.subscribe(function(message) { + setFrame(that.particles, message.header.frame_id); + + var n = message.ranges.length; + for(var i=0;i message.range_max){ + that.particles.alpha[i] = 0.0; + }else{ + var angle = message.angle_min + i * message.angle_increment; + that.particles.points[i] = new THREE.Vector3( range * Math.cos(angle), range * Math.sin(angle), 0.0 ); + that.particles.alpha[i] = 1.0; + } + that.particles.colors[ i ] = new THREE.Color( that.color ); + } + + finishedUpdate(that.particles, n); + }); +}; +ROS3D.LaserScan.prototype.__proto__ = THREE.Object3D.prototype; diff --git a/src/sensors/Particles.js b/src/sensors/Particles.js index 5fc5ffab..255dc323 100644 --- a/src/sensors/Particles.js +++ b/src/sensors/Particles.js @@ -19,7 +19,7 @@ ROS3D.Particles = function(options) { this.tfClient = options.tfClient; var texture = options.texture || 'https://upload.wikimedia.org/wikipedia/commons/a/a2/Pixel-white.png'; var size = options.size || 0.05; - this.max_pts = options.max_pts || 100; + this.max_pts = options.max_pts || 10000; this.first_size = null; this.prev_pts = 0; this.rootObject = options.rootObject || new THREE.Object3D(); @@ -118,8 +118,8 @@ function finishedUpdate(particles, n) particles.prev_pts = n; particles.geom.verticesNeedUpdate = true; - particles.colors.needsUpdate = true; - particles.alpha.needsUpdate = true; + particles.attribs.customColor.needsUpdate = true; + particles.attribs.alpha.needsUpdate = true; if(n>particles.max_pts){ throw 'Attempted to draw more points than max_pts allows'; From bbd1563563376eb9b8696761e2b7192a4fcf5f4e Mon Sep 17 00:00:00 2001 From: David Lu Date: Wed, 15 Jul 2015 18:41:31 -0400 Subject: [PATCH 05/11] Polygon --- src/navigation/Polygon.js | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/navigation/Polygon.js diff --git a/src/navigation/Polygon.js b/src/navigation/Polygon.js new file mode 100644 index 00000000..59061e8f --- /dev/null +++ b/src/navigation/Polygon.js @@ -0,0 +1,68 @@ +/** + * @author David V. Lu!! - davidvlu@gmail.com + */ + +/** + * A PolygonStamped client that listens to a given topic and displays the polygon + * + * @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 + * * color (optional) - color for line (default: 0xcc00ff) + */ +ROS3D.Polygon = function(options) { + options = options || {}; + var ros = options.ros; + var topic = options.topic || '/path'; + this.tfClient = options.tfClient; + this.color = options.color || 0xcc00ff; + this.rootObject = options.rootObject || new THREE.Object3D(); + var that = this; + THREE.Object3D.call(this); + + this.sn = null; + this.line = null; + + var rosTopic = new ROSLIB.Topic({ + ros : ros, + name : topic, + messageType : 'geometry_msgs/PolygonStamped' + }); + + rosTopic.subscribe(function(message) { + if(that.sn!==null){ + that.rootObject.remove(that.sn); + } + + var lineGeometry = new THREE.Geometry(); + var v3; + for(var i=0; i Date: Wed, 15 Jul 2015 19:18:42 -0400 Subject: [PATCH 06/11] Pose --- src/navigation/Pose.js | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/navigation/Pose.js diff --git a/src/navigation/Pose.js b/src/navigation/Pose.js new file mode 100644 index 00000000..7f31998f --- /dev/null +++ b/src/navigation/Pose.js @@ -0,0 +1,65 @@ +/** + * @author David V. Lu!! - davidvlu@gmail.com + */ + +/** + * A PoseStamped client + * + * @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 + * * color (optional) - color for line (default: 0xcc00ff) + * * length (optional) - the length of the arrow (default: 1.0) + * * headLength (optional) - the head length of the arrow (default: 0.2) + * * shaftDiameter (optional) - the shaft diameter of the arrow (default: 0.05) + * * headDiameter (optional) - the head diameter of the arrow (default: 0.1) + */ +ROS3D.Pose = function(options) { + this.options = options || {}; + var ros = options.ros; + var topic = options.topic || '/pose'; + this.tfClient = options.tfClient; + this.color = options.color || 0xcc00ff; + this.rootObject = options.rootObject || new THREE.Object3D(); + var that = this; + THREE.Object3D.call(this); + + this.sn = null; + + var rosTopic = new ROSLIB.Topic({ + ros : ros, + name : topic, + messageType : 'geometry_msgs/PoseStamped' + }); + + rosTopic.subscribe(function(message) { + if(that.sn!==null){ + that.rootObject.remove(that.sn); + } + + that.options.origin = new THREE.Vector3( message.pose.position.x, message.pose.position.y, + message.pose.position.z); + + var rot = new THREE.Quaternion(message.pose.orientation.x, message.pose.orientation.y, + message.pose.orientation.z, message.pose.orientation.w); + that.options.direction = new THREE.Vector3(1,0,0); + that.options.direction.applyQuaternion(rot); + that.options.material = new THREE.MeshBasicMaterial({color: that.color}); + var arrow = new ROS3D.Arrow(that.options); + + that.sn = new ROS3D.SceneNode({ + frameID : message.header.frame_id, + tfClient : that.tfClient, + object : arrow + }); + + that.rootObject.add(that.sn); + }); + + +}; +ROS3D.Pose.prototype.__proto__ = THREE.Object3D.prototype; From dc038f1500f087ff323bf8ce3e4b2d71ccbbd54c Mon Sep 17 00:00:00 2001 From: David Lu Date: Thu, 16 Jul 2015 19:33:16 -0400 Subject: [PATCH 07/11] Pose Array --- src/navigation/PoseArray.js | 85 +++++++++++++++++++++++++++++++++++++ src/sensors/LaserScan.js | 1 - 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 src/navigation/PoseArray.js diff --git a/src/navigation/PoseArray.js b/src/navigation/PoseArray.js new file mode 100644 index 00000000..2b5f2298 --- /dev/null +++ b/src/navigation/PoseArray.js @@ -0,0 +1,85 @@ +/** + * @author David V. Lu!! - davidvlu@gmail.com + */ + +/** + * A PoseArray client + * + * @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 + * * color (optional) - color for line (default: 0xcc00ff) + * * length (optional) - the length of the arrow (default: 1.0) + */ +ROS3D.PoseArray = function(options) { + this.options = options || {}; + var ros = options.ros; + var topic = options.topic || '/particlecloud'; + this.tfClient = options.tfClient; + this.color = options.color || 0xcc00ff; + this.length = options.length || 1.0; + this.rootObject = options.rootObject || new THREE.Object3D(); + var that = this; + THREE.Object3D.call(this); + + this.sn = null; + + var rosTopic = new ROSLIB.Topic({ + ros : ros, + name : topic, + messageType : 'geometry_msgs/PoseArray' + }); + + rosTopic.subscribe(function(message) { + if(that.sn!==null){ + that.rootObject.remove(that.sn); + } + + var group = new THREE.Object3D(); + var line; + + for(var i=0;i Date: Thu, 16 Jul 2015 21:27:36 -0400 Subject: [PATCH 08/11] Odometry --- src/navigation/Odometry.js | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/navigation/Odometry.js diff --git a/src/navigation/Odometry.js b/src/navigation/Odometry.js new file mode 100644 index 00000000..ad153d2f --- /dev/null +++ b/src/navigation/Odometry.js @@ -0,0 +1,69 @@ +/** + * @author David V. Lu!! - davidvlu@gmail.com + */ + +/** + * An Odometry client + * + * @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 + * * keep (optional) - number of markers to keep around (default: 1) + * * color (optional) - color for line (default: 0xcc00ff) + * * length (optional) - the length of the arrow (default: 1.0) + * * headLength (optional) - the head length of the arrow (default: 0.2) + * * shaftDiameter (optional) - the shaft diameter of the arrow (default: 0.05) + * * headDiameter (optional) - the head diameter of the arrow (default: 0.1) + */ +ROS3D.Odometry = function(options) { + this.options = options || {}; + var ros = options.ros; + var topic = options.topic || '/particlecloud'; + this.tfClient = options.tfClient; + this.color = options.color || 0xcc00ff; + this.length = options.length || 1.0; + this.rootObject = options.rootObject || new THREE.Object3D(); + this.keep = options.keep || 1; + var that = this; + THREE.Object3D.call(this); + + this.sns = []; + + var rosTopic = new ROSLIB.Topic({ + ros : ros, + name : topic, + messageType : 'nav_msgs/Odometry' + }); + + rosTopic.subscribe(function(message) { + if(that.sns.length >= that.keep) { + that.rootObject.remove(that.sns[0]); + that.sns.shift(); + } + + that.options.origin = new THREE.Vector3( message.pose.pose.position.x, message.pose.pose.position.y, + message.pose.pose.position.z); + + var rot = new THREE.Quaternion(message.pose.pose.orientation.x, message.pose.pose.orientation.y, + message.pose.pose.orientation.z, message.pose.pose.orientation.w); + that.options.direction = new THREE.Vector3(1,0,0); + that.options.direction.applyQuaternion(rot); + that.options.material = new THREE.MeshBasicMaterial({color: that.color}); + var arrow = new ROS3D.Arrow(that.options); + + that.sns.push(new ROS3D.SceneNode({ + frameID : message.header.frame_id, + tfClient : that.tfClient, + object : arrow + })); + + that.rootObject.add(that.sns[ that.sns.length - 1]); + }); + + +}; +ROS3D.Odometry.prototype.__proto__ = THREE.Object3D.prototype; From 7b01b4da9ee8083e49557b23f1ff242ec103d1ae Mon Sep 17 00:00:00 2001 From: David Lu Date: Thu, 16 Jul 2015 22:21:26 -0400 Subject: [PATCH 09/11] Point --- src/navigation/Point.js | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/navigation/Point.js diff --git a/src/navigation/Point.js b/src/navigation/Point.js new file mode 100644 index 00000000..f2ac11f9 --- /dev/null +++ b/src/navigation/Point.js @@ -0,0 +1,58 @@ +/** + * @author David V. Lu!! - davidvlu@gmail.com + */ + +/** + * A PointStamped client + * + * @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 + * * color (optional) - color for line (default: 0xcc00ff) + * * radius (optional) - radius of the point (default: 0.2) + */ +ROS3D.Point = function(options) { + this.options = options || {}; + var ros = options.ros; + var topic = options.topic || '/point'; + this.tfClient = options.tfClient; + this.color = options.color || 0xcc00ff; + this.rootObject = options.rootObject || new THREE.Object3D(); + this.radius = options.radius || 0.2; + var that = this; + THREE.Object3D.call(this); + + this.sn = null; + + var rosTopic = new ROSLIB.Topic({ + ros : ros, + name : topic, + messageType : 'geometry_msgs/PointStamped' + }); + + rosTopic.subscribe(function(message) { + if(that.sn!==null){ + that.rootObject.remove(that.sn); + } + + var sphereGeometry = new THREE.SphereGeometry( that.radius ); + var sphereMaterial = new THREE.MeshBasicMaterial( {color: that.color} ); + var sphere = new THREE.Mesh(sphereGeometry, sphereMaterial); + sphere.position.set(message.point.x, message.point.y, message.point.z); + + that.sn = new ROS3D.SceneNode({ + frameID : message.header.frame_id, + tfClient : that.tfClient, + object : sphere + }); + + that.rootObject.add(that.sn); + }); + + +}; +ROS3D.Point.prototype.__proto__ = THREE.Object3D.prototype; From 67b89271a961bf249ad5711261600b02ffb5ff43 Mon Sep 17 00:00:00 2001 From: David Lu Date: Sat, 25 Jul 2015 13:55:52 -0400 Subject: [PATCH 10/11] White space hacking --- src/navigation/Odometry.js | 42 ++++++++++---------- src/navigation/Path.js | 40 ++++++++++--------- src/navigation/Point.js | 36 +++++++++--------- src/navigation/Polygon.js | 52 ++++++++++++------------- src/navigation/Pose.js | 42 ++++++++++---------- src/navigation/PoseArray.js | 76 ++++++++++++++++++------------------- src/sensors/PointCloud2.js | 1 - 7 files changed, 137 insertions(+), 152 deletions(-) diff --git a/src/navigation/Odometry.js b/src/navigation/Odometry.js index ad153d2f..9e13dd38 100644 --- a/src/navigation/Odometry.js +++ b/src/navigation/Odometry.js @@ -39,31 +39,29 @@ ROS3D.Odometry = function(options) { messageType : 'nav_msgs/Odometry' }); - rosTopic.subscribe(function(message) { - if(that.sns.length >= that.keep) { - that.rootObject.remove(that.sns[0]); - that.sns.shift(); - } + rosTopic.subscribe(function(message) { + if(that.sns.length >= that.keep) { + that.rootObject.remove(that.sns[0]); + that.sns.shift(); + } - that.options.origin = new THREE.Vector3( message.pose.pose.position.x, message.pose.pose.position.y, - message.pose.pose.position.z); + that.options.origin = new THREE.Vector3( message.pose.pose.position.x, message.pose.pose.position.y, + message.pose.pose.position.z); - var rot = new THREE.Quaternion(message.pose.pose.orientation.x, message.pose.pose.orientation.y, - message.pose.pose.orientation.z, message.pose.pose.orientation.w); - that.options.direction = new THREE.Vector3(1,0,0); - that.options.direction.applyQuaternion(rot); - that.options.material = new THREE.MeshBasicMaterial({color: that.color}); - var arrow = new ROS3D.Arrow(that.options); + var rot = new THREE.Quaternion(message.pose.pose.orientation.x, message.pose.pose.orientation.y, + message.pose.pose.orientation.z, message.pose.pose.orientation.w); + that.options.direction = new THREE.Vector3(1,0,0); + that.options.direction.applyQuaternion(rot); + that.options.material = new THREE.MeshBasicMaterial({color: that.color}); + var arrow = new ROS3D.Arrow(that.options); - that.sns.push(new ROS3D.SceneNode({ - frameID : message.header.frame_id, - tfClient : that.tfClient, - object : arrow - })); - - that.rootObject.add(that.sns[ that.sns.length - 1]); - }); - + that.sns.push(new ROS3D.SceneNode({ + frameID : message.header.frame_id, + tfClient : that.tfClient, + object : arrow + })); + that.rootObject.add(that.sns[ that.sns.length - 1]); + }); }; ROS3D.Odometry.prototype.__proto__ = THREE.Object3D.prototype; diff --git a/src/navigation/Path.js b/src/navigation/Path.js index 67bcecca..dabc54c0 100644 --- a/src/navigation/Path.js +++ b/src/navigation/Path.js @@ -33,31 +33,29 @@ ROS3D.Path = function(options) { messageType : 'nav_msgs/Path' }); - rosTopic.subscribe(function(message) { - if(that.sn!==null){ - that.rootObject.remove(that.sn); - } + rosTopic.subscribe(function(message) { + if(that.sn!==null){ + that.rootObject.remove(that.sn); + } - var lineGeometry = new THREE.Geometry(); - for(var i=0; i Date: Sat, 25 Jul 2015 13:58:40 -0400 Subject: [PATCH 11/11] White space hacking 2 --- src/navigation/Odometry.js | 4 ++-- src/navigation/Path.js | 6 +++--- src/navigation/Point.js | 2 +- src/navigation/Polygon.js | 4 ++-- src/navigation/Pose.js | 2 +- src/navigation/PoseArray.js | 12 ++++++------ src/sensors/Particles.js | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/navigation/Odometry.js b/src/navigation/Odometry.js index 9e13dd38..cf244f5d 100644 --- a/src/navigation/Odometry.js +++ b/src/navigation/Odometry.js @@ -47,14 +47,14 @@ ROS3D.Odometry = function(options) { that.options.origin = new THREE.Vector3( message.pose.pose.position.x, message.pose.pose.position.y, message.pose.pose.position.z); - + var rot = new THREE.Quaternion(message.pose.pose.orientation.x, message.pose.pose.orientation.y, message.pose.pose.orientation.z, message.pose.pose.orientation.w); that.options.direction = new THREE.Vector3(1,0,0); that.options.direction.applyQuaternion(rot); that.options.material = new THREE.MeshBasicMaterial({color: that.color}); var arrow = new ROS3D.Arrow(that.options); - + that.sns.push(new ROS3D.SceneNode({ frameID : message.header.frame_id, tfClient : that.tfClient, diff --git a/src/navigation/Path.js b/src/navigation/Path.js index dabc54c0..2b4d6f34 100644 --- a/src/navigation/Path.js +++ b/src/navigation/Path.js @@ -44,17 +44,17 @@ ROS3D.Path = function(options) { message.poses[i].pose.position.z); lineGeometry.vertices.push(v3); } - + lineGeometry.computeLineDistances(); var lineMaterial = new THREE.LineBasicMaterial( { color: that.color } ); var line = new THREE.Line( lineGeometry, lineMaterial ); - + that.sn = new ROS3D.SceneNode({ frameID : message.header.frame_id, tfClient : that.tfClient, object : line }); - + that.rootObject.add(that.sn); }); }; diff --git a/src/navigation/Point.js b/src/navigation/Point.js index 04f88685..0c7783f0 100644 --- a/src/navigation/Point.js +++ b/src/navigation/Point.js @@ -49,7 +49,7 @@ ROS3D.Point = function(options) { tfClient : that.tfClient, object : sphere }); - + that.rootObject.add(that.sn); }); }; diff --git a/src/navigation/Polygon.js b/src/navigation/Polygon.js index 4ed808a6..f3a65c54 100644 --- a/src/navigation/Polygon.js +++ b/src/navigation/Polygon.js @@ -51,13 +51,13 @@ ROS3D.Polygon = function(options) { lineGeometry.computeLineDistances(); var lineMaterial = new THREE.LineBasicMaterial( { color: that.color } ); var line = new THREE.Line( lineGeometry, lineMaterial ); - + that.sn = new ROS3D.SceneNode({ frameID : message.header.frame_id, tfClient : that.tfClient, object : line }); - + that.rootObject.add(that.sn); }); }; diff --git a/src/navigation/Pose.js b/src/navigation/Pose.js index 18612a12..ec7ce6fe 100644 --- a/src/navigation/Pose.js +++ b/src/navigation/Pose.js @@ -50,7 +50,7 @@ ROS3D.Pose = function(options) { that.options.direction.applyQuaternion(rot); that.options.material = new THREE.MeshBasicMaterial({color: that.color}); var arrow = new ROS3D.Arrow(that.options); - + that.sn = new ROS3D.SceneNode({ frameID : message.header.frame_id, tfClient : that.tfClient, diff --git a/src/navigation/PoseArray.js b/src/navigation/PoseArray.js index dd5c1d26..b637d234 100644 --- a/src/navigation/PoseArray.js +++ b/src/navigation/PoseArray.js @@ -41,14 +41,14 @@ ROS3D.PoseArray = function(options) { var group = new THREE.Object3D(); var line; - + for(var i=0;i