0
$\begingroup$

I have specified a URDF relating the world with a table and a Microsoft Kinect mounted on a pole attached to this table.

The URDF parses successfully with check_urdf:

---------- Successfully Parsed XML ---------------
root Link: world has 1 child(ren)
    child(1):  table
        child(1):  kinect_mount
            child(1):  kinect

However, loading this URDF with robot_state_publisher and then checking RViz, the relationships do not appear to work correctly. Whatever link I set as the fixed frame shows with "Transform OK", but it cannot determine transforms for the other links:

transform error

The position of the links reported in RViz also does not match what is set in the URDF:

position mismatch

I am new to URDF but this example is largely copied from an existing tutorial online, where no such errors were described by the author. I have attached the full URDF and launch file respectively below:

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

    <!-- World declaration -->
    <link name="world"></link>

    <!-- World to table -->
    <joint name="table_to_world" type="fixed">
        <origin xyz="1.5 1.0 0" rpy="0 0 0"/>
        <parent link="world"/>
        <child link="table"/>
    </joint>

    <link name="table">
        <visual>
            <origin xyz="0 0 0.05" rpy="0 0 0"/>
            <geometry>
                <box size="2.5 1.5 0.1"/>
            </geometry>
            <material name="green">
                <color rgba="0.2 1 0.2 1"/>
            </material>
        </visual>
        <!-- <inertial>
            <mass value="1"/>
            <inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
        </inertial> -->
    </link>

    <!-- Table to Kinect mount -->
    <joint name="table_to_kinect_mount" type="fixed">
        <origin xyz="1.5 1.0 0" rpy="0 0 0"/>
        <parent link="table"/>
        <child link="kinect_mount"/>
    </joint>

    <link name="kinect_mount">
        <visual>
            <origin xyz="-1.25 0 0.1" rpy="0 0 0"/>
            <geometry>
                <box size="0.1 0.1 0.1"/>
            </geometry>
            <material name="green">
                <color rgba="0.2 1 0.2 1"/>
            </material>
        </visual>
        <!-- <inertial>
            <mass value="1"/>
            <inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
        </inertial> -->
    </link>

    <!-- Kinect mount to Kinect -->
    <joint name="kinect_to_kinect_mount" type="fixed">
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <parent link="kinect_mount"/>
        <child link="kinect"/>
    </joint>

    <link name="kinect">
        <visual>
            <geometry>
                <sphere radius="0.05"/>
            </geometry>
        </visual>
    </link> 

</robot>

launch (please note this runs inside an ephemeral container where the xacro file is converted to pure URDF as part of the container build stage):

<launch>
    <!-- Load the urdf into the parameter server -->
    <param name="robot_description" textfile="/app/urdf/robot.urdf"/>

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    </node>
</launch>

Any suggestions are much appreciated!

$\endgroup$

1 Answer 1

1
$\begingroup$

Solved; it was an issue with the container networking configuration. I am testing with RViz outside of the container and only port 11311 was forwarded. rosnode ping robot_state_publisher failed, so I switched it to host networking for testing, and all the transforms work.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.