Skip to content

Commit

Permalink
Merge pull request #45 from rctoris/devel
Browse files Browse the repository at this point in the history
URDF meshes are now scaled correctly
  • Loading branch information
baalexander committed Jun 5, 2013
2 parents 6051c23 + 5db350f commit 1940017
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
DEVEL - **r6**
* MARKER_CUBE_LIST added to Marker.js [(rctoris)](https://github.com/rctoris/)
* URDF meshes are now scaled correctly [(rctoris)](https://github.com/rctoris/)

2013-05-29 - **r5**
* Added DepthCloud class for point ploud streaming with ros_web_video and depthcloud_encoder ([jkammerl](https://github.com/jkammerl/), [dgossow](https://github.com/dgossow/))
Expand Down
20 changes: 16 additions & 4 deletions build/ros3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -2252,15 +2252,27 @@ ROS3D.Urdf = function(options) {

// ignore mesh files which are not in Collada format
if (fileType === '.dae') {
// create the model
var mesh = new ROS3D.MeshResource({
path : path,
resource : uri.substring(10)
});

// check for a scale
if(link.visual.geometry.scale) {
mesh.scale = new THREE.Vector3(
link.visual.geometry.scale.x,
link.visual.geometry.scale.y,
link.visual.geometry.scale.z
);
}

// 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)
})
object : mesh
});
this.add(sceneNode);
}
Expand Down
2 changes: 1 addition & 1 deletion build/ros3d.min.js

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions src/urdf/Urdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,27 @@ ROS3D.Urdf = function(options) {

// ignore mesh files which are not in Collada format
if (fileType === '.dae') {
// create the model
var mesh = new ROS3D.MeshResource({
path : path,
resource : uri.substring(10)
});

// check for a scale
if(link.visual.geometry.scale) {
mesh.scale = new THREE.Vector3(
link.visual.geometry.scale.x,
link.visual.geometry.scale.y,
link.visual.geometry.scale.z
);
}

// 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)
})
object : mesh
});
this.add(sceneNode);
}
Expand Down

0 comments on commit 1940017

Please sign in to comment.