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

Link not showing in Rviz

asked 2015-04-26 18:03:41 -0500

Cerin gravatar image

Can someone help me determine why Rviz is only showing one link in a urdf file that contains two?

I have a very simple model consisting of a large box representing a torso, and a smaller thinner box representing a leg.

myrobot.urdf.xacro:

<?xml version="1.0"?>
<robot name="myrobot"
    xmlns:xacro="http://www.ros.org/wiki/xacro">
    <!-- Included URDF/XACRO Files -->
    <xacro:include filename="$(find myrobot_description)/urdf/materials.urdf.xacro" />
    <!-- PROPERTY LIST -->
    <!-- Main Body-base -->
    <property name="torso_x_size" value="0.1" />
    <!-- width in cm -->
    <property name="torso_y_size" value="0.2" />
    <!-- length in cm -->
    <property name="torso_z_size" value="0.03" />
    <!-- height in cm -->
    <property name="torso_mass" value="0.920" />
    <!-- in kg -->
    <property name="upper_leg_mass" value="0.010" />
    <!-- in kg -->
    <link name="torso">
        <visual>
            <geometry>
                <box size="${torso_x_size} ${torso_y_size} ${torso_z_size}" />
            </geometry>
            <material name="red"/>
        </visual>
        <xacro:default_inertial mass="${torso_mass}"/>
    </link>
    <xacro:macro name="leg" params="name reflect_x reflect_y">
        <link name="${name}">
            <visual>
                <geometry>
                    <box size="0.003 0.04 0.005" />
                </geometry>
                <origin xyz="0 0.04 0" rpy="0 0 0"/>
                <material name="blue" />
            </visual>
            <collision>
                <geometry>
                    <box size="0.003 0.04 0.005" />
                </geometry>
                <origin xyz="0 0.04 0" rpy="0 0 0"/>
            </collision>
            <xacro:default_inertial mass="${upper_leg_mass}"/>
        </link>
        <joint name="torso_to_${name}" type="fixed">
            <parent link="torso"/>
            <child link="${name}"/>
            <origin xyz="${torso_x_size/2*reflect_x} ${torso_y_size/2*reflect_y} 0" />
        </joint>
    </xacro:macro>
    <xacro:leg name="front_right_leg" reflect_x="1" reflect_y="1" />
</robot>

When I run:

roslaunch urdf_tutorial xacrodisplay.launch model:='$(find myrobot_description)/urdf/myrobot.urdf.xacro'

all I see is the first box, rendered as a flat unshaded white blob. The second box is listed in the "RobotModel" tree in the left-hand panel, but it's not visible anywhere. How do I fix this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-04-27 02:30:32 -0500

gvdhoorn gravatar image

This is likely related to RViz reporting no fixed frame.

You might find the RViz user guide helpful. It's a bit dated, but the sections on coordinate frames should still apply.

edit flag offensive delete link more

Comments

Yes, I arrived at that other thread from a different direction, but the underlying issue was the same. Once I corrected it to use base_link, Rviz renders it with the correct color and shading.

Cerin gravatar image Cerin  ( 2015-04-27 14:13:25 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-04-26 18:03:41 -0500

Seen: 1,717 times

Last updated: Apr 27 '15