ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

robot_state_publisher tf fail.

asked 2019-03-31 21:47:24 -0500

jdj gravatar image

updated 2019-04-01 02:03:33 -0500

jayess gravatar image

map -> odom odom -> base_link succeeds in passing tf.

However, it fails to pass from base_footprint to base_link.

For example, when I check the tf tree: Broadcaster: / robot_state_publisher Average rate: 10000.0 Buffer lenth: 0.0 Most recent transform: 0.0 Oldest transform: 0.0

I wonder why I can not receive the data.

--- URDF File ---

<robot name = "robot">

    <link name = "base_footprint" />

    <parent link = "base_footprint" />
    <child link = "base_link" />
    <origin xyz = "0.0 0.0 0.010" rpy = "0 0 0" />
    <parent name = "base_joint" / joint>

    <link name = "base_link">
        <visual> 
            <geometry>
                <box size = "0.5 .26 .04" /> 
            </geometry>
            <origin rpy = "0 0 0" xyz = "0 0 0.075" material name = "body">
                <color rgba = "1.0 0.423529411765 0.0392156862745 1.0" />
                </material>
        </visual>
    </link>

    <link name="wheel_left1">
        <parent link="base_link"/>
        <visual>
            <geometry>
                <cylinder length="0.04" radius="0.065"/>
            </geometry>
            <origin rpy="1.57 0 0" xyz="0.20 0.14 0.065"/>
            <material name="wheel">
                <color rgba="0.0 0.0 0.0 1.0"/>
            </material>
        </visual>
    </link>

    <link name="wheel_right1">
        <visual>
            <geometry>
                <cylinder length="0.04" radius="0.065" />
            </geometry>
            <origin rpy="1.57 0 0" xyz="0.20 -0.14 0.065" />
            <material name="wheel">
                <color rgba="0.0 0.0 0.0 1.0" />
            </material>
        </visual>
    </link>

    <link name="wheel_left2">
        <parent link="base_link" />
        <visual>
            <geometry>
                <cylinder length="0.04" radius="0.065" />
            </geometry>
            <origin rpy="1.57 0 0" xyz="-0.20 0.14 0.065" />
            <material name="wheel">
                <color rgba="0.0 0.0 0.0 1.0" />
            </material>
        </visual>
    </link>
    <link name="wheel_right2">
        <visual>
            <geometry>
                <cylinder length="0.04" radius="0.065" />
            </geometry>
            <origin rpy="1.57 0 0" xyz="-0.20 -0.14 0.065" />
            <material name="wheel">
                <color rgba="0.0 0.0 0.0 1.0" />
            </material>
        </visual>
    </link>

    <link name="base_scan">
        <visual>
            <geometry>
                <cylinder length="0.08" radius="0.05" />
            </geometry>
            <origin rpy="0 0 0" xyz="0.20 0 0.10" />
            <material name="laser">
                <color rgba="0.0 0.0 0.0 1.0" />
            </material>
        </visual>
        <sensor name="base_scan" update_rate="20">
            <parent link="base_link" />
            <origin xyz="0.2 0 0.5165" rpy="0 0 0" />
            <ray>
                <horizontal samples="100" resolution="1" min_angle="-1.5708" max_angle="1.5708" />
                <vertical samples="1" resolution="1" min_angle="0" max_angle="0" />
            </ray>
        </sensor>
    </link>


    <joint name="joint1" type="fixed">
        <parent link="base_link" />
        <child link="wheel_left1" />
        <origin xyz="0 0 0" />
    </joint>

    <joint name="joint2" type="fixed">
        <parent link="base_link" />
        <child link="wheel_right1" />
        <origin xyz="0 0 0" />
    </joint>

    <joint name="joint3" type="fixed">
        <parent link="base_link" />
        <child link="wheel_left2" />
        <origin xyz="0 0 0" />
    </joint>

    <joint name="joint4" type="fixed">
        <parent link="base_link" />
        <child link="wheel_right2" />
        <origin xyz="0 0 0" />
    </joint>

    <joint name="joint5" type="fixed">
        <parent link="base_link" />
        <child link="base_scan" />
    </joint>
</robot>

rviz related files

<launch>
    <arg name="model" default="$(find dynamixel_workbench_operators)/urdf/robot.urdf" />
    <arg name="gui" default="False" />
    <param name="robot_description" textfile="$(arg model)" />
    <param name="use_gui" value="$(arg gui)" />
    <node pkg="dynamixel_workbench_operators" type="wheel_test" name="wheel_test"/>
    <node name="joint_state_publisher" pkg="joint_state_publisher ...
(more)
edit retag flag offensive close merge delete

Comments

Can you please translate your question to English? As this is an English-language site

jayess gravatar image jayess  ( 2019-04-01 01:49:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-04-01 02:14:44 -0500

jayess gravatar image

updated 2019-04-01 02:16:53 -0500

There are a few issues with your URDF file which is why I'm writing an answer instead of a comment.

Line 8:

<parent name = "base_joint" / joint>

should it be

<parent name = "base_joint" />

Line 15:

<origin rpy = "0 0 0" xyz = "0 0 0.075" material name = "body">

should it be

<origin rpy = "0 0 0" xyz = "0 0 0.075"/>
<material name = "body">

I'm not sure how you didn't get any error with these errors in your URDF file because they make it an invalid XML file. Try fixing these errors and see what happens. Note that I only ran your file through an XML beautifier to make it easier to read and these errors showed up.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-03-31 21:47:24 -0500

Seen: 316 times

Last updated: Apr 01 '19