Skip to content

Fixed URDF mesh materials being overridden by color materials.#187

Merged
jihoonl merged 1 commit intoRobotWebTools:developfrom
jstnhuang:fix_urdf
Jul 27, 2017
Merged

Fixed URDF mesh materials being overridden by color materials.#187
jihoonl merged 1 commit intoRobotWebTools:developfrom
jstnhuang:fix_urdf

Conversation

@jstnhuang
Copy link
Contributor

From the develop branch (c36fbdb), this is what the Fetch URDF looks like:

image

This is because ROS3D.Urdf always uses a color material if a color is specified for the link: https://github.com/RobotWebTools/ros3djs/blob/develop/src/urdf/Urdf.js#L60

Then, that color material is always used for the MeshResource, even if the node already has a material (as discussed in #112 and implemented in #128). I think that change is correct, since we want to support colored meshes.

However, when using meshes in the context of a URDF, maybe we should not use the color material? I think most people want their URDF displays to reflect the mesh material and not some solid color.

This PR produces the following behaviors:

  • For URDF mesh links: the mesh material is used instead of a color material
  • For URDF non-mesh links: colorMaterial is still used for these links, so the behavior is unchanged
  • For mesh markers: behavior unchanged

After making this change, this is what the Fetch URDF looks like:
image

And here is what two robot marker arrays look like (from the robot_markers demo).

image

@jihoonl
Copy link
Member

jihoonl commented Jul 27, 2017

thanks

@jihoonl jihoonl merged commit f27587a into RobotWebTools:develop Jul 27, 2017
@jstnhuang jstnhuang deleted the fix_urdf branch July 27, 2017 22:42
jihoonl pushed a commit that referenced this pull request Dec 8, 2017
jihoonl pushed a commit that referenced this pull request Dec 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants