Skip to content

URDFSpawner does not set the robot Physics & BoundingObject when the base link does not have a collision tag #201

Open
@PymZoR

Description

@PymZoR

Describe the Bug
A common use in the ROS world of the urdf file associated with the robot_state_publisher node and the tf_system is to set up all the static_transforms known in advance directly in the urdf file. For instance, it's common to have the base_footprint -> base_link static joint, where base_footprint is a "virtual" link with no Solid attached to it. When spawining, the resulting robot does have neither Physics or BoudingObject properties set, resulting in a robot not in kinematic behavior.

In addition, the base link is converted as a Solid where a Transform would be more appropriate. More generally, an empty link should result in a Transform in webots, a link with only a <visual> tag should result in a Transform + a Shape, and only a link with a <collision> tag should result in a Solid.

Steps to Reproduce
Consider the following urdf file :

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

    <!-- BASE FOOTPRINT -->
    <link name="base_footprint"></link>

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


    <!-- 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>

</robot>

Expected behavior
With the urdf provided, the robot should be in kinematic mode. In addition, the base link is converted as a Solid where a Transform would be more appropriate. More generally, an empty link should result in a Transform in webots, a link with only a <visual> tag should result in a Transform + a Shape, and only a link with a <collision> tag should result in a Solid.

Affected Packages
List of affected packages:

  • webots_ros2_driver

System

  • Webots Version: R2023a for macOS
  • ROS Version: Humble
  • Operating System: Ubuntu jammy in docker, host macOS Monterey 12.2.1, using local_simulation_server.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions