[ROS2 URDF Course] Mesh not rendered in the gazebo simulator

Hello @bayodesegun @girishkumar.kannan
I am trying to build the tb3 burger from ROS2 URDF and am at a point where i have mostly completed unit 5 section but i cannot see the laser mesh in gazebo but i see as a cylinder when i rotate the laser. can you please check and point me to resolve this item ?

  <!-- Visual Laser Model to be rotated -->
  <link name="laser_scan_model_link">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
     <geometry>
        <mesh filename="package://ros2_urdf_project/meshes/sensors/rplidar.dae" scale="1.0 1.0 1.0"/>
      </geometry>
    </visual>

    <collision>
       <origin rpy="0 0 0" xyz="0 0 0.0204"/>
      <geometry>
        <cylinder length="0.0408" radius="0.037493"/>
      </geometry>
    </collision>

    <inertial>

      <mass value="0.01"/>
      <origin rpy="0 0 0" xyz="0 0 0.0204"/>
      <inertia ixx="6.066578520833334e-06" ixy="0" ixz="0" iyy="6.072950163333333e-06" iyz="0" izz="9.365128684166666e-06"/>
    </inertial>
  </link>

Logs from the launch.

[rviz2-2]          at line 156 in /tmp/binarydeb/ros-galactic-tf2-0.17.2/src/buffer_core.cpp
[spawner-5] [INFO] [1737811327.514481278] [spawner_joint_state_broadcaster]: Configured and started joint_state_broadcaster
[INFO] [spawner-5]: process has finished cleanly [pid 4901]
[INFO] [spawner-6]: process started with pid [4942]
[spawner-6] [INFO] [1737811328.748107281] [spawner_joint_trajectory_controller]: Loaded joint_trajectory_controller
[spawner-6] [INFO] [1737811328.795863058] [spawner_joint_trajectory_controller]: Configured and started joint_trajectory_controller
[INFO] [spawner-6]: process has finished cleanly [pid 4942]
[INFO] [spawner-7]: process started with pid [4967]
[spawner-7] [INFO] [1737811330.775392399] [spawner_velocity_controller]: Loaded velocity_controller
[spawner-7] [INFO] [1737811330.802094161] [spawner_velocity_controller]: Configured and started velocity_controller
[INFO] [spawner-7]: process has finished cleanly [pid 4967]

In rviz.

In gazebo

Hi @vadhrivenkat ,

If you can’t see the mesh in Gazebo, then there are few steps that you can check.

  1. Is the path defined for the mesh file correct in the URDF/XACRO file?
  2. Are you also exporting the folder that contains the mesh files in your CMakeLists.txt file?
  3. Did you properly add (export) the path to the mesh files (from the install directory) to the gazebo resources path environment variable in the launch file?

If you did the above 3 steps correctly, then you should be able to see the mesh on Gazebo.

If you are sure (or not sure) if you did those steps correctly and still the mesh file does not show up, check if you actually have the mesh file in the specified path.

If all fails, post all the file contents of your launch file, urdf/xacro file, CMakeLists file along with a screenshot of your ROS2 package folder organization with all sub-folders expanded as a tree view. Then someone can help you solve your issue! But try yourself first, don’t be hasty to post all your files here!

Regards,
Girish

Thanks, i got the small issue in the #3 you highlighted above.
I am able to see the mesh in gazebo.

Hi @vadhrivenkat ,

Wonderful that you were able to solve the issue without further help!

Please mark the corresponding post as “Solution” so this issue can be closed!

Regards,
Girish

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.