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?
Originally posted by Cerin on ROS Answers with karma: 940 on 2015-04-26
Post score: 0