Why can't my URDF be like my SDF in rviz?
So, basically...I learned that ROS2 foxy does not support SDF with plugins and ROS2. So, I had to re-update one for URDF instead of SDF. I made SDF enitrely from Gazebo11.
So, the question is why can't I put wheels on the box? Take a look at this URDF code:
<?xml version="1.0"?>
<robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">
<!-- Define robot constants -->
<xacro:property name="base_width" value="0.2159"/>
<xacro:property name="base_length" value="0.1524"/>
<xacro:property name="base_height" value="0.10795"/>
<xacro:property name="wheel_radius" value="0.0325"/>
<xacro:property name="wheel_width" value="0.02"/>
<xacro:property name="wheel_ygap" value="0.088"/>
<xacro:property name="wheel_zoff" value="0.05"/>
<xacro:property name="wheel_xoff" value="0.1"/>
<xacro:property name="caster_xoff" value="0.14"/>
<!-- Robot Base -->
<link name="base_link">
<visual>
<geometry>
<box size="0.2159 0.1524 0.10795"/>
</geometry>
<material name="Cyan">
<color rgba="0 1.0 1.0 1.0"/>
</material>
</visual>
</link>
<!-- Robot Footprint -->
<link name="base_footprint"/>
<joint name="base_joint" type="fixed">
<parent link="base_link"/>
<child link="base_footprint"/>
<origin xyz="0.0 0.0 ${-(wheel_radius+wheel_zoff)}" rpy="0 0 0"/>
</joint>
<!-- Wheels -->
<xacro:macro name="wheel" params="prefix x_reflect y_reflect">
<link name="${prefix}_link">
<visual>
<origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
<geometry>
<cylinder radius="${wheel_radius}" length="${wheel_width}"/>
</geometry>
<material name="Gray">
<color rgba="0.5 0.5 0.5 1.0"/>
</material>
</visual>
</link>
<joint name="${prefix}_joint" type="continuous">
<parent link="base_link"/>
<child link="${prefix}_link"/>
<origin xyz="${x_reflect*wheel_xoff} ${y_reflect*(base_width/6+wheel_ygap)} ${-wheel_zoff}" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
</joint>
</xacro:macro>
<xacro:wheel prefix="drivewhl_rl" x_reflect="-1" y_reflect="1" />
<xacro:wheel prefix="drivewhl_rr" x_reflect="-1" y_reflect="-1" />
<xacro:wheel prefix="drivewhl_fl" x_reflect="1" y_reflect="1" />
<xacro:wheel prefix="drivewhl_fr" x_reflect="1" y_reflect="-1" />
</robot>
The model look like this
As for my SDF code and picture like this:
<link name='chassis'>
<pose>0 0 .1 0 0 0</pose>
<inertial>
<inertia>
<ixx>1.000000</ixx>
<ixy>0.000000</ixy>
<ixz>0.000000</ixz>
<iyy>1.000000</iyy>
<iyz>0.000000</iyz>
<izz>1.000000</izz>
</inertia>
<mass>1</mass>
</inertial>
<collision name='collision'>
<geometry>
<box>
<size>0.2159 0.1524 0.10795</size>
</box>
</geometry>
</collision>
<visual name='visual'>
<geometry>
<box>
<size>0.2159 0.1524 0.10795</size>
</box>
</geometry>
</visual>
</link>
<link name="front_left_wheel">
<pose>0.1 0.088 0.05 0 1.5707 1.5707</pose>
<mass>0.75</mass>
<collision name="collision">
<geometry>
<cylinder>
<radius>0.0325</radius>
<length>.02</length>
</cylinder>
</geometry>
</collision>
<visual name="visual">
<geometry>
<cylinder>
<radius>0.0325</radius>
<length> ...