Skip to content

support multiple material for one link - #812

Closed
k-okada wants to merge 1 commit into
ros-visualization:hydro-develfrom
k-okada:support_multiple_material_for_link
Closed

k-okada wants to merge 1 commit into
ros-visualization:hydro-develfrom
k-okada:support_multiple_material_for_link

Conversation

@k-okada

@k-okada k-okada commented Sep 14, 2014

Copy link
Copy Markdown
Contributor

This is patches for setting multiple materials for one link. I understand this is not clean patch, but anyway send PR and hoping someone will find more better way.

c.f: http://answers.ros.org/question/154816/color-issue-with-urdf-and-multiple-visual-tags/

you need following patch to urdf_parser.

diff --git a/urdf_parser/src/link.cpp b/urdf_parser/src/link.cpp
index b69824a..e324651 100644
--- a/urdf_parser/src/link.cpp
+++ b/urdf_parser/src/link.cpp
@@ -380,7 +380,8 @@ bool parseVisual(Visual &vis, TiXmlElement *config)
     }
   }

-  vis.group_name = std::string("default");
+  //vis.group_name = std::string("default");
+  vis.group_name = vis.material_name;
   const char *group_name_char = config->Attribute("group");
   if (group_name_char)
     logWarn("The notion of a group name for visual tags is not supported by URDF.");

@wjwwood wjwwood added this to the untargeted milestone Sep 19, 2014
@mmoerdijk

Copy link
Copy Markdown

what is the status on this PR? Is this already implemented?

@wjwwood

wjwwood commented Feb 9, 2017

Copy link
Copy Markdown
Member

It's in the untargeted milestone: https://github.com/ros-visualization/rviz/milestone/102

It's probably this way because it requires (or required) a patch in urdf_parser.

@mmoerdijk

Copy link
Copy Markdown

Thanks for the quick reply @wjwwood , I looked at urdf_parser and it is a bit different now than at the time @k-okada submitted this patch. I think the corresponding code is now here.

If I understand the patch that @k-okada submitted correctly it changes the vis.group_name from default to the material name. But if I look at the current code of the urdf_paser it already uses the matrial name for vis.name (group_name does not exist any more).

I don't have experience with the rviz or de urdfdom code base, but could it be that the urdf_parser already implements the behavior required for this PR? Or am I missing something?

@k-okada

k-okada commented Feb 12, 2017

Copy link
Copy Markdown
Contributor Author

@mmoerdijk thank you for your research, See #1079 or #1080 for rewrited version of this PR using material name for vis.name. Please check if this works for you. Note that I totally forget what I did a year ago, so the code is not so confident ,

@mmoerdijk

Copy link
Copy Markdown

@k-okada Thanks! I somehow totally missed this comment, I will test it on Monday.

@mmoerdijk

Copy link
Copy Markdown

@k-okada I tested the indigo PR and can confirm it works for me. Thanks again.
@wjwwood could you say what you would need to merge these PR's? And if it is possible to cherry pick it to jade as well.

@wjwwood

wjwwood commented Mar 2, 2017

Copy link
Copy Markdown
Member

@mmoerdijk just time on my end. I need to test them out and merge other pr's before doing a release. I'm going to do a round of releases in preparation for ROS Lunar (which should be soonish).

@wjwwood

wjwwood commented Apr 29, 2017

Copy link
Copy Markdown
Member

closing in favor of #1079 and #1080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants