cyberbotics / urdf2webots

Utility to convert URDF files to Webots PROTO nodes
Apache License 2.0
127 stars 43 forks source link

URDFSpawner does not preserve link names, messing the TF tree when using the ros2_webots_driver with robot_state_publisher #209

Open PymZoR opened 1 year ago

PymZoR commented 1 year ago

Describe the Bug All links are converted into Solids which have names "Solid[N]" instead of their original name in the URDF file.

Steps to Reproduce Consider the following urdf :

<?xml version="1.0"?>
<robot name="myrobot"
    xmlns:xacro="http://ros.org/wiki/xacro">

    <!-- BASE LINK -->
    <link name="base_link">
        <visual>
            <origin xyz="0 0 0.075" />
            <geometry>
                <box size="0.3 0.3 0.15" />
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0.075" />
            <geometry>
                <box size="0.3 0.3 0.15" />
            </geometry>
        </collision>
    </link>

    <joint name="laser_link_joint" type="fixed">
        <parent link="base_link" />
        <child link="laser_link" />
        <origin xyz="0 0 1" />
    </joint>

    <!-- LINK2 -->
    <link name="laser_link">
        <visual>
            <origin xyz="0 0 0.075" />
            <geometry>
                <box size="0.3 0.3 0.15" />
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0.075" />
            <geometry>
                <box size="0.3 0.3 0.15" />
            </geometry>
        </collision>
    </link>
</robot>

The link laser_link is turned into Solid0 (cf screenshot). The workaround is to set the parameter "set_robot_state_publisher": False for the webots_ros2_driver ROS node, and populate /robot_description by hand. This is regrettable !

Expected behavior Original names should be preserved.

Affected Packages List of affected packages:

Screenshots

image

System

bonnuite commented 9 months ago

The problem is still unresolved and what is more than regrettable, is that on _https://github.com/cyberbotics/webots_ros2/wiki/Example-Universal-Robots_ has nothing mentioned about this serious issue.

System: Webots Version: R2023b for Ubuntu ROS Version: ROS2 Humble Operating System: Ubuntu 22.04.3 LTS in VMware Workstation 16 image