[ROS1, Gazebo] URDF doesn't work on Gazebo
Hi everyone, I'm quietly new to Gazebo, and I need to spawn my robot in it. I wrote the URDF file by hand, and it works fine in MATLAB, and also in Rviz, where I can actuate the joints without any issue. By the way, trying to import it in Gazebo, it just appears as a model (on the left, through the true structure of the system), but it doesn't spawn in the simulation. I tried to launch it both with the "manual" method (launching an empty world before and then spwaning the robot) and with a complete launch file. Can anyone help me?
<?xml version="1.0"?>
<robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">
<material name="red">
<color rgba="1.0 0 0 1.0"/>
</material>
<material name="qbmove/flange">
<color rgba="0.0 0.5 0.8 1.0"/>
</material>
<material name="qbmove/cube">
<color rgba="0.35 0.35 0.35 1.0"/>
</material>
<material name="qbmove/shaft">
<color rgba="0.8 0.8 0.8 1.0"/>
</material>
<material name="qbmove/default">
<color rgba="0.35 0.35 0.35 1.0"/>
</material>
<material name="SoftBlue">
<color rgba="0.0 0.0 0.8 0.9"/>
</material>
<material name="SoftLightBlue">
<color rgba="0.0 0.4 1.0 1.0"/>
</material>
<material name="wheel">
<color rgba="0.50 0.50 0.50 1.0"/>
</material>
<link name="base_link">
<inertial>
<mass value="0.00000001"/>
<inertia ixx="0.00000001" ixy="0" ixz="0" iyy="0.00000001" iyz="0" izz="0.00000001"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
</inertial>
</link>
<joint name="rot_x" type="revolute">
<axis xyz="1 0 0"/>
<limit effort="50.0" lower="0" upper="+1.57075" velocity="50.0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="base_link"/>
<child link="body"/>
</joint>
<link name="body">
<visual>
<material name="SoftBlue"/>
<geometry>
<cylinder radius="0.04" length="0.74"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0.248 0.50"/>
</visual>
<inertial>
<origin xyz="0 0.248 0.50"/>
<mass value="12.787"/>
<inertia ixx="0" ixy="0" ixz="0" iyy="2.33" iyz="0" izz="2.33"/>
</inertial>
<collision>
<geometry>
<cylinder radius="0.04" length="0.74"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0.248 0.50"/>
</collision>
</link>
<gazebo reference="body">
<material>Gazebo/Blue</material>
</gazebo>
<link name="upper_axle">
<visual>
<material name="SoftBlue"/>
<geometry>
<cylinder radius="0.02" length="0.368"/>
</geometry>
<origin rpy="-1.57075 0 0" xyz="0 0 0"/>
</visual>
<inertial>
<mass value="1e-8"/>
<inertia ixx="1e-8" ixy="0" ixz="0" iyy="1e-8" iyz="0" izz ...
Can you check this when "Collisions" is marked as visible? Maybe it's not loading the materials correctly. Please add your launch file and an empty Gazebo world with the model added.