ros-industrial / motoman

ROS-Industrial Motoman support (http://wiki.ros.org/motoman)
145 stars 192 forks source link

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

Open dignakov opened 4 years ago

dignakov commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 3 years ago

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.