Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error material 'yaskawa_blue' is not unique when using multiple robots #314

Open
dignakov opened this issue Feb 9, 2020 · 3 comments
Open
Labels

Comments

@dignakov
Copy link

dignakov commented Feb 9, 2020

When using multiple robots each seems to add a definition for yaskawa_blue, causing this error:

[ERROR] [1581285016.618736830]: material 'yaskawa_blue' is not unique.

System: Ubuntu 18.04, ROS-melodic, motoman package from git.

example xacro (my_robot_workspace.xacro):

<?xml version="1.0" ?>

<robot name="my_robot_workspace" xmlns:xacro="http://ros.org/wiki/xacro">
    <xacro:include filename="$(find motoman_gp25_support)/urdf/gp25_macro.xacro" />

    <xacro:motoman_gp25 prefix="first_"/>
    <xacro:motoman_gp25 prefix="second_"/>

    <link name="world" />

    <joint name="world-first_base_link" type="fixed">
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <parent link="world"/>
        <child link="first_base_link"/>
    </joint>

    <joint name="world-second_base_link" type="fixed">
        <origin xyz="0 1.5 0" rpy="0 0 0"/>
        <parent link="world"/>
        <child link="second_base_link"/>
    </joint>

</robot>

load_my_robot.launch

<launch>
	<param name="robot_description" command="$(find xacro)/xacro -\-inorder '$(find my_robot)/urdf/my_robot_workspace.xacro'" />
</launch>

test_robot.launch

<?xml version="1.0" ?>
<launch>
	<include file="$(find my_robot)/launch/load_my_robot.launch" />
	<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" >
		<param name="use_gui" value="true" />
	</node>
	<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find my_robot)/config/rviz_config.rviz" required="true" />

</launch>
@gavanderhoorn
Copy link
Member

Yes, this is an unfortunate side-effect of all macros redefining yaskawa_blue.

We could introduce a motoman_resources package (similar to fanuc_resources, abb_resources, etc) which provides this definition once and then reuse it everywhere.

@EvilPictureBook: could you please update your OP with information about your ROS version? Afaik newer versions of xacro should namespace definitions like this with the scope they are defined in (so yaskawa_blue would be local to motoman_gp25).

@dignakov
Copy link
Author

could you please update your OP with information about your ROS version?

Thanks, updated, and I also provided the launch and test files in case I'm doing something wrong there.

Please let me know if there's something I could test to see why the name-spacing isn't working.

@Doomerdinger
Copy link
Contributor

Before I go and add a resources package and change everything to use it, am I understanding correctly that @gavanderhoorn you don't think this should be an issue with newer xacro versions since the definitions should be namespaced?

I'm using the latest as far as I can tell, and while most things namespace properly the material definitions still seem to break.

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

No branches or pull requests

3 participants