URDF broken rendering in RVIZ
I need help understanding why my urdf keeps breaking in Rviz. (I apologise for the length of this question).
The problem I am experiencing is my robot only part renders in Rviz. To make matters worse, I am loading the same urdf from two seperate packages and both result in widely difference output in Rviz.
I've followed and almost finished the ROS URDF tutorial. From that tutorial I have the following xacro:
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="R2D2">
<xacro:property name="bot" value="R2D2"/>
<material name="blue">
<color rgba="0.0 0.0 1.0 1.0"/>
</material>
<material name="white">
<color rgba="1.0 1.0 1.0 1.0"/>
</material>
<material name="green">
<color rgba="0.0 1.0 0.0 1.0"/>
</material>
<material name="red">
<color rgba="1.0 0.0 0.0 1.0"/>
</material>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>
<!-- Base Link -->
<xacro:property name="base_link_radius" value="0.2"/>
<xacro:property name="base_link_length" value="0.6"/>
<link name="base_link">
<visual name="">
<geometry>
<cylinder radius="${base_link_radius}" length="${base_link_length}"/>
</geometry>
<material name="blue"/>
</visual>
<collision>
<geometry>
<cylinder radius="${base_link_radius}" length="${base_link_length}"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<!-- LEGS -->
<xacro:macro name="leg" params="prefix flip">
<xacro:property name="leg_dimensions" value="0.6 0.1 0.2"/>
<link name="${prefix}_leg_link">
<visual>
<geometry>
<box size="${leg_dimensions}"/>
</geometry>
<origin xyz="0.0 0.0 -0.3" rpy="0.0 1.57075 0.0"/>
<material name="white"/>
</visual>
<collision>
<geometry>
<box size="${leg_dimensions}"/>
</geometry>
<origin xyz="0.0 0.0 -0.3" rpy="0.0 1.57075 0.0"/>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<joint name="base_to_${prefix}_leg" type="fixed">
<parent link="base_link"/>
<child link="${prefix}_leg_link"/>
<origin xyz="0.0 ${flip * -0.22} 0.25" rpy="0.0 0.0 0.0"/>
</joint>
</xacro:macro>
<xacro:leg prefix="right" flip="1" />
<xacro:leg prefix="left" flip="-1"/>
<!-- Leg bases -->
<xacro:macro name="legbase" params="prefix switch">
<xacro:property name="legbase_dimensions" value="0.4 0.1 0.1"/>
<link name="${prefix}_leg_base_link">
<visual name="">
<geometry>
<box size="${legbase_dimensions}"/>
</geometry>
<material name="white"/>
</visual>
<collision>
<geometry>
<box size="${legbase_dimensions}"/>
</geometry>
</collision>
<inertial>
<mass value="10.0"/>
<inertia ixx="0.4" ixy="0.0 ...