I’m trying to make a model of a robot projected by myself. If I run it on RViz it comes out very well with all the collision parts and visual parts. But if I run it on Gazebo, when Rviz opens, there is written that there aren’t the TF for the 2 wheels. I attach the screen of the robot on RViz. I don’t know how to resolve this problem.
I also attach the xacro file: <?xml version="1.0"?>
<link name="base_footprint" />
<link name="base_link">
<visual>
<geometry>
<mesh filename="package://my_robot_description/meshes/chassis-V5.stl" scale="0.001 0.001 0.001"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 ${pi / 2.0}"/>
<material name="blue" />
</visual>
<collision>
<geometry>
<box size="0.093 0.067 0.005" />
</geometry>
<origin xyz="-0.015 0 0" rpy="0 0 0"/>
</collision>
<xacro:box_inertia m="0.4" x="0.093" y="0.067" z="0.005"
xyz="-0.015 0 0" rpy="0 0 0" />
</link>
<link name="motor_dx_link">
<visual>
<geometry>
<mesh filename="package://my_robot_description/meshes/motor.stl" scale="0.001 0.001 0.001"/>
</geometry>
<origin xyz="0 0 0" rpy="${pi / 2.0} 0 0"/>
<material name="green" />
</visual>
<collision>
<geometry>
<box size="0.025 0.01 0.01" />
</geometry>
<origin xyz="-0.005 0 0.002" rpy="0 0 0"/>
</collision>
<xacro:box_inertia m="0.4" x="0.025" y="0.01" z="0.01"
xyz="-0.005 0 0.002" rpy="0 0 0" />
</link>
<link name="motor_sx_link">
<visual>
<geometry>
<mesh filename="package://my_robot_description/meshes/motor.stl" scale="0.001 0.001 0.001"/>
</geometry>
<origin xyz="0 0 0" rpy="${pi / 2.0} 0 0"/>
<material name="green" />
</visual>
<collision>
<geometry>
<box size="0.025 0.01 0.01" />
</geometry>
<origin xyz="-0.005 0 0.002" rpy="0 0 0"/>
</collision>
<xacro:box_inertia m="0.4" x="0.025" y="0.01" z="0.01"
xyz="-0.005 0 0.002" rpy="0 0 0" />
</link>
<link name="wheel_dx_link">
<visual>
<geometry>
<mesh filename="package://my_robot_description/meshes/wheel.stl" scale="0.001 0.001 0.001"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
<material name="grey" />
</visual>
<collision>
<geometry>
<cylinder radius="0.016" length="0.005" />
</geometry>
<origin xyz="0.004 0 0" rpy="${pi / 2.0} 0 ${pi / 2.0}"/>
</collision>
<xacro:cylinder_inertia m="0.2" r="0.016" h="0.005"
xyz="0.004 0 0" rpy="0 0 0" />
</link>
<link name="wheel_sx_link">
<visual>
<geometry>
<mesh filename="package://my_robot_description/meshes/wheel.stl" scale="0.001 0.001 0.001"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
<material name="grey" />
</visual>
<collision>
<geometry>
<cylinder radius="0.016" length="0.005" />
</geometry>
<origin xyz="0.004 0 0" rpy="${pi / 2.0} 0 ${pi / 2.0}"/>
</collision>
<xacro:cylinder_inertia m="0.2" r="0.016" h="0.005"
xyz="0.004 0 0" rpy="0 0 0" />
</link>
<link name="top_link">
<visual>
<geometry>
<mesh filename="package://my_robot_description/meshes/Floor-1-V2.stl" scale="0.001 0.001 0.001"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 ${-pi / 2.0}"/>
<material name="orange" />
</visual>
<collision>
<geometry>
<box size="0.093 0.067 0.005" />
</geometry>
<origin xyz="-0.015 0 0" rpy="0 0 0"/>
</collision>
<xacro:box_inertia m="0.4" x="0.093" y="0.067" z="0.005"
xyz="-0.015 0 0" rpy="0 0 0" />
</link>
<link name="sensor_link">
<visual>
<geometry>
<mesh filename="package://my_robot_description/meshes/sensor.stl" scale="0.001 0.001 0.001"/>
</geometry>
<origin xyz="0.02 -0.013 0" rpy="${pi / 2.0} 0 ${pi / 2.0}"/>
<material name="yellow" />
</visual>
</link>
<link name="caster_wheel_link">
<visual>
<geometry>
<sphere radius="0.006" />
</geometry>
<origin xyz="0 0 0" rpy="0 0 0" />
<material name="grey" />
</visual>
<collision>
<geometry>
<sphere radius="0.006" />
</geometry>
<origin xyz="0 0 0" rpy="0 0 0" />
</collision>
<xacro:sphere_inertia m="0.2" r="0.006" xyz="0 0 0" rpy="0 0 0" />
</link>
<joint name="base_joint" type="fixed">
<parent link="base_footprint" />
<child link="base_link" />
<origin xyz="0 0 0.011" rpy="0 0 0" />
</joint>
<joint name="base_motor_dx_joint" type="fixed">
<parent link="base_link" />
<child link="motor_dx_link" />
<origin xyz="0 -0.024 0.005" rpy="0 0 ${-pi / 2.0}" />
</joint>
<joint name="base_motor_sx_joint" type="fixed">
<parent link="base_link" />
<child link="motor_sx_link" />
<origin xyz="0 0.024 0.005" rpy="0 0 ${pi / 2.0}" />
</joint>
<joint name="motor_dx_wheel_dx_joint" type="continuous">
<parent link="motor_dx_link" />
<child link="wheel_dx_link" />
<origin xyz="0.011 0 0" rpy="0 0 0" />
<axis xyz="1 0 0" />
</joint>
<joint name="motor_sx_wheel_sx_joint" type="continuous">
<parent link="motor_sx_link" />
<child link="wheel_sx_link" />
<origin xyz="0.02 0 0" rpy="0 0 ${pi}" />
<axis xyz="1 0 0" />
</joint>
<joint name="base_top_link" type="fixed">
<parent link="base_link" />
<child link="top_link" />
<origin xyz="-0.003 0 0.035" rpy="0 0 0" />
</joint>
<joint name="base_sensor_link" type="fixed">
<parent link="base_link" />
<child link="sensor_link" />
<origin xyz="0.035 0 0" rpy="0 0 0" />
</joint>
<joint name="base_caster_wheel_link" type="fixed">
<parent link="base_link" />
<child link="caster_wheel_link" />
<origin xyz="-0.052 0 -0.005" rpy="0 0 0" />
</joint>