Importing models in Final Project

I’ve followed the instructions to create the world using the GUI and it was a disaster, since it seems due to the version used in the tutorial and the version installed are different, because the instructions are specified for Ignition, but the world saved was using the gz-sim plugins, so it made a sdf mess.

After cleaning it up and changing how the models were being referenced, I am able to spawn all the models except the actors using the launch file. If I run gz sim <path_to_world_file> it opens smoothly, but if I try to do it using launch file, it appears the next error:
[ign gazebo-1] [GUI] [Err] [SceneManager.cc:979] Mesh skeleton in [model://PatientWheelChair/meshes/PatientWheelChair.obj] not found. [ign gazebo-1] [GUI] [Err] [SceneManager.cc:979] Mesh skeleton in [model://person_walking/meshes/walking.dae] not found.
Still, if I go to the Resource Spawner, I’m able to spawn both models with no problem. but I need to do it using the sdf file because of the position assigned.

Hi @angeloga.rea ,

I need more information on the actor models that you are using and your environment setup.
Please provide me with the following information.

  1. Your world sdf file contents.
  2. Your package file organization (expand all the sub-folders and post a screenshot of the package contents)
  3. Your launch file contents.

With these information, I would be able to provide you better assistance.

Regards,
Girish

Hello @girishkumar.kannan, sure, I attach each file you requested:

final_world.sdf

<?xml version="1.0"?>

<sdf version='1.9'>
  <world name='empty'>
        <physics name="1ms" type="ignored">
            <max_step_size>0.001</max_step_size>
            <real_time_factor>1.0</real_time_factor>
        </physics>

        <plugin
            filename="libignition-gazebo-physics-system.so"
            name="ignition::gazebo::systems::Physics">
        </plugin>

        <plugin
            filename="libignition-gazebo-user-commands-system.so"
            name="ignition::gazebo::systems::UserCommands">
        </plugin>

        <plugin
            filename="libignition-gazebo-scene-broadcaster-system.so"
            name="ignition::gazebo::systems::SceneBroadcaster">
        </plugin>

        <gravity>0 0 -9.8</gravity>
        <magnetic_field>5.565e-06 2.289e-05 -4.239e-05</magnetic_field>
        <atmosphere type='adiabatic'/>

        <scene>
            <ambient>0.4 0.4 0.4 1</ambient>
            <background>0.7 0.7 0.7 1</background>
            <shadows>true</shadows>
        </scene>

        <model name='ground_plane'>
            <pose>0 0 0 0 0 0</pose>
            <self_collide>false</self_collide>
            <static>true</static>
            <link name='ground'>
                <pose>0 0 0 0 0 0</pose>
                <enable_wind>false</enable_wind>
                <visual name='visual'>
                    <geometry>
                        <plane>
                            <normal>0 0 1</normal>
                            <size>10 10</size>
                        </plane>
                    </geometry>
                    <material>
                        <ambient>0.8 0.8 0.8 1</ambient>
                        <diffuse>0.8 0.8 0.8 1</diffuse>
                        <specular>0.8 0.8 0.8 1</specular>
                        <emissive>0.0 0.0 0.0 1</emissive>
                    </material>
                </visual>
                <collision name='collision'>
                    <geometry>
                        <plane>
                            <normal>0 0 1</normal>
                            <size>10 10</size>
                        </plane>
                    </geometry>
                    <surface>
                        <friction>
                            <ode>
                            </ode>
                        </friction>
                        <bounce/>
                        <contact/>
                    </surface>
                </collision>
                <inertial>
                    <pose>0 0 0 0 0 0</pose>
                    <mass>1</mass>
                    <inertia>
                        <ixx>1</ixx>
                        <ixy>0</ixy>
                        <ixz>0</ixz>
                        <iyy>1</iyy>
                        <iyz>0</iyz>
                        <izz>1</izz>
                    </inertia>
                </inertial>
            </link>
        </model>

        <light type="directional" name="sun">
            <cast_shadows>true</cast_shadows>
            <pose>0 0 10 0 0 0</pose>
            <diffuse>0.8 0.8 0.8 1</diffuse>
            <specular>0.2 0.2 0.2 1</specular>
            <attenuation>
                <range>1000</range>
                <constant>0.9</constant>
                <linear>0.01</linear>
                <quadratic>0.001</quadratic>
            </attenuation>
            <direction>-0.5 0.1 -0.9</direction>
        </light>

    <model name='Wall'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>-5.0000000000000009 4.3368086899420177e-19 0 0 0 1.5704</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_0'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>0 -5 0 0 0 0</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_1'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>0 5 0 0 0 0</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_2'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>5 0 0 0 0 1.5704</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_3'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>2.5 -5 0 0 0 0</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_4'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>5 -2.5000000000000009 0 0 0 1.5704</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_5'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>2.5 5 0 0 0 0</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_6'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>-2.5 -5 0 0 0 0</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_7'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>-5 -2.5 0 0 0 1.5704</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_8'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>5 2.5 0 0 0 1.5704</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_9'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>-5 2.5000000000000009 0 0 0 1.5704</pose>
      <self_collide>false</self_collide>
    </model>
    <model name='Wall_10'>
      <static>true</static>
      <link name='link'>
        <pose>0 0 0 0 0 0</pose>
        <visual name='visual'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <material>
            <ambient>0.75 0.75 0.75 1</ambient>
            <diffuse>0.75 0.75 0.75 1</diffuse>
            <specular>0 0 0 1</specular>
            <emissive>0 0 0 1</emissive>
          </material>
        </visual>
        <collision name='collision'>
          <geometry>
            <box>
              <size>5 0.20000000000000001 2.5</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode/>
            </friction>
            <bounce/>
            <contact/>
          </surface>
        </collision>
        <inertial>
          <pose>0 0 0 0 0 0</pose>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <enable_wind>false</enable_wind>
      </link>
      <pose>-2.5 5 0 0 0 0</pose>
      <self_collide>false</self_collide>
    </model>
    <actor name="cheered_actor">
        <skin>
            <filename>model://PatientWheelChair/meshes/PatientWheelChair.obj</filename>
        </skin>
        <animation name="cheer_walk">
            <filename>model://PatientWheelChair/meshes/PatientWheelChair.obj</filename>
            <interpolate_x>true</interpolate_x>
        </animation>
        <script>
            <loop>true</loop>
            <delay_start>5.0</delay_start>
            <auto_start>true</auto_start>
            <trajectory id="0" type="walk" tension="0.75">
                <waypoint>
                    <time>0.0</time>
                    <pose>-3.0 2.5 0.0 0 0 0</pose>
                </waypoint>
                <waypoint>
                    <time>10.0</time>
                    <pose>1.5 2.5 0.0 0 0 0</pose>
                </waypoint>
                <waypoint>
                    <time>11.0</time>
                    <pose>1.5 2.5 0.0 0 0 3.1416</pose>
                </waypoint>
                <waypoint>
                    <time>20</time>
                    <pose>-3.0 2.5 0.0 0 0 3.1416</pose>
                </waypoint>
                <waypoint>
                    <time>21</time>
                    <pose>-3.0 2.5 0.0 0 0 0</pose>
                </waypoint>
            </trajectory>
        </script>
    </actor>    

    <actor name="walking_actor">
        <skin>
            <filename>model://Walking person/meshes/walking.dae</filename>
            <scale>1.5</scale>
        </skin>
        <animation name="walk">
            <filename>model://Walking person/meshes/walking.dae</filename>
            <interpolate_x>true</interpolate_x>
            <scale>1.5</scale>
        </animation>
        <script>
            <loop>true</loop>
            <delay_start>1.0</delay_start>
            <auto_start>true</auto_start>
            <trajectory id="0" type="walk" tension="0.75">
                <waypoint>
                    <time>0.0</time>
                    <pose>-2.5 1.0 0.0 0 0 0</pose>
                </waypoint>
                <waypoint>
                    <time>10.0</time>
                    <pose>-1.0 -2.5 0.0 0 0 0.75</pose>
                </waypoint>
                <waypoint>
                    <time>17.5</time>
                    <pose>1.0 -1.0 0.0 0 0 1.5704</pose>
                </waypoint>
                <waypoint>
                    <time>20.0</time>
                    <pose>1.0 -1.0 0.0 0 0 4.7107</pose>
                </waypoint>
                <waypoint>
                    <time>30</time>
                    <pose>-2.5 1.0 0.0 0 0 4.7107</pose>
                </waypoint>
                <waypoint>
                    <time>31</time>
                    <pose>-2.5 1.0 0.0 0 0 0.0</pose>
                </waypoint>
            </trajectory>
        </script>
    </actor>    

    <model name="CoffeeTable">
        <include>
        <uri>
        https://fuel.gazebosim.org/1.0/OpenRobotics/models/CoffeeTable
        </uri>
        <scale>0.0125 0.0125 0.0125</scale>
        </include>
        <pose>1.9277 -2.1841 -0.0001 0 0 0</pose>
    </model>

    <model name="Bed">
        <include>
        <uri>
        https://fuel.gazebosim.org/1.0/OpenRobotics/models/Bed
        </uri>
        </include>
        <pose>2.8687852082651837 3.3016162672658211 0 0 0 0</pose>
    </model>

    <model name="fuel mascot">
        <include>
        <uri>
        https://fuel.gazebosim.org/1.0/OpenRobotics/models/Harmonic Mascot
        </uri>
        <scale>2 2 2</scale>
        </include>
        <pose>-3.22377122697986 -2.7103001192386937 0 0 0 0</pose>
    </model>

    <model name="Fridge">
        <include>
        <uri>
        https://fuel.gazebosim.org/1.0/OpenRobotics/models/Refrigerator
        </uri>
        </include>
        <pose>-4.45 -2.7103001192386937 0 0 0 0</pose>
    </model>
  </world>
</sdf>

2 Package organization

user:~/ros2_ws/src$ tree final_project/
final_project/
|-- final_project
|   `-- __init__.py
|-- launch
|   |-- final_project.launch.py
|   |-- rviz.launch.py
|   `-- spawn_robot.launch.py
|-- models
|   |-- Bed
|   |   |-- materials
|   |   |   `-- textures
|   |   |       |-- Bed_Albedo.png
|   |   |       |-- Bed_Normal.png
|   |   |       `-- Bed_Roughness.png
|   |   |-- meshes
|   |   |   `-- bed.dae
|   |   |-- model.config
|   |   |-- model.sdf
|   |   `-- thumbnails
|   |       `-- Bed.png
|   |-- CoffeeTable
|   |   |-- meshes
|   |   |   |-- CoffeeTable.mtl
|   |   |   |-- CoffeeTable.obj
|   |   |   |-- CoffeeTable_Diffuse.png
|   |   |   |-- CoffeeTable_Normal.png
|   |   |   `-- CoffeeTable_SpecGloss.png
|   |   |-- model.config
|   |   |-- model.sdf
|   |   `-- thumbnails
|   |       |-- 1.png
|   |       |-- 2.png
|   |       |-- 3.png
|   |       |-- 4.png
|   |       `-- 5.png
|   |-- HarmonicMascot
|   |   |-- materials
|   |   |   `-- textures
|   |   |       `-- harmonic_logo.png
|   |   |-- meshes
|   |   |   `-- harmonic_mascot.dae
|   |   |-- model.config
|   |   |-- model.sdf
|   |   `-- thumbnails
|   |       `-- Mascot.png
|   |-- PatientWheelChair
|   |   |-- meshes
|   |   |   |-- PatientWheelChair.mtl
|   |   |   |-- PatientWheelChair.obj
|   |   |   |-- PatientWheelChair_Col.mtl
|   |   |   |-- PatientWheelChair_Col.obj
|   |   |   `-- PatientWheelChair_Diffuse.png
|   |   |-- model.config
|   |   |-- model.sdf
|   |   `-- thumbnails
|   |       |-- 1.png
|   |       |-- 2.png
|   |       |-- 3.png
|   |       |-- 4.png
|   |       `-- 5.png
|   |-- Refrigerator
|   |   |-- materials
|   |   |   `-- textures
|   |   |       |-- Fridge_Albedo.jpg
|   |   |       |-- Fridge_Metalness.jpg
|   |   |       |-- Fridge_Normal.png
|   |   |       `-- Fridge_Roughness.jpg
|   |   |-- meshes
|   |   |   `-- fridge.dae
|   |   |-- model.config
|   |   |-- model.sdf
|   |   `-- thumbnails
|   |       `-- Fridge.png
|   |-- Walking\ person
|   |   |-- materials
|   |   |   `-- textures
|   |   |       |-- eyebrow001-unmodified.png
|   |   |       |-- eyebrow001.png
|   |   |       |-- green_eye.png
|   |   |       |-- jeans01_normals.png
|   |   |       |-- jeans_basic_diffuse.png
|   |   |       |-- male02_diffuse_black-unmodified.png
|   |   |       |-- male02_diffuse_black.png
|   |   |       |-- teeth.png
|   |   |       |-- tshirt02_normals.png
|   |   |       |-- tshirt02_texture.png
|   |   |       `-- young_lightskinned_male_diffuse.png
|   |   |-- meshes
|   |   |   `-- walking.dae
|   |   |-- model.config
|   |   |-- model.sdf
|   |   `-- thumbnails
|   |       |-- 1.png
|   |       |-- 2.png
|   |       |-- 3.png
|   |       |-- 4.png
|   |       `-- 5.png
|   `-- Wall
|       |-- model.config
|       `-- model.sdf
|-- package.xml
|-- resource
|   `-- final_project
|-- setup.cfg
|-- setup.py
|-- test
|   |-- test_copyright.py
|   |-- test_flake8.py
|   `-- test_pep257.py
|-- urdf
|   `-- final_robot.xacro
`-- worlds
    `-- final_world.sdf

3 Launch file

import os
from ament_index_python.packages import (get_package_prefix, get_package_share_directory)
from launch import LaunchDescription
from launch.actions import (DeclareLaunchArgument, IncludeLaunchDescription)
from launch.substitutions import (PathJoinSubstitution, LaunchConfiguration)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import SetParameter
from launch.actions import SetEnvironmentVariable
# ROS2 Launch System will look for this function definition #
def generate_launch_description():

    # Get Package Description and Directory #
    package_description = "final_project"
    package_directory = get_package_share_directory(package_description)

    # Necesario para introducir los modelos personalizados (setear la env variable)
    install_dir_path = (get_package_prefix(package_description) + "/share")
    robot_meshes_path = os.path.join(package_directory, "meshes")
    gz_fuel = os.path.join(package_directory, "models")
    # models_path = os.path.join(package_directory, "models")
    print("Iniciando simulacion...")
    # gazebo_resource_paths = [install_dir_path, robot_meshes_path, models_path]
    gazebo_resource_paths = [install_dir_path, robot_meshes_path, gz_fuel]
    if "IGN_GAZEBO_RESOURCE_PATH" in os.environ:
        for resource_path in gazebo_resource_paths:
            if resource_path not in os.environ["IGN_GAZEBO_RESOURCE_PATH"]:
                os.environ["IGN_GAZEBO_RESOURCE_PATH"] += (':' + resource_path)
    else:
        os.environ["IGN_GAZEBO_RESOURCE_PATH"] = (':'.join(gazebo_resource_paths))

    # Load Empty World SDF from Gazebo Sim Package #
    world_file = "final_world.sdf"
    world_path = os.path.join(package_directory, "worlds", world_file)
    world_config = LaunchConfiguration("world")
    declare_world_arg = DeclareLaunchArgument("world",
                                              default_value=["-r ", world_path],
                                              description="SDF World File")
    
    # Declare GazeboSim Launch #
    gzsim_pkg = get_package_share_directory("ros_gz_sim")
    gz_sim = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(
            PathJoinSubstitution([gzsim_pkg, "launch", "gz_sim.launch.py"])),
            launch_arguments={"gz_args": world_config}.items(),
    )

    # Create and Return the Launch Description Object #
    return LaunchDescription(
        [
            declare_world_arg,
            # Sets use_sim_time for all nodes started below (doesn't work for nodes started from ignition gazebo) #
            SetParameter(name="use_sim_time", value=True),
            gz_sim,
        ]
    )

And just in case I messed something with setup.py

from setuptools import setup
import os
from glob import glob
package_name = 'final_project'
def generate_paths(dir_name):
    paths = glob(dir_name + '/**', recursive=True)
    paths = [path for path in paths if os.path.isfile(path)]
    paths = sorted(list(set(['/'.join(path.split('/')[0:-1]) for path in paths])))
    paths = [(os.path.join('share', package_name, path), glob(path + '/*.*')) for path in paths]
    return paths

setup(
    name=package_name,
    version='0.0.0',
    packages=[package_name],
    data_files=[
        ('share/ament_index/resource_index/packages',
            ['resource/' + package_name]),
        ('share/' + package_name, ['package.xml']),
        (os.path.join('share', package_name, 'urdf'), glob('urdf/*.*')),
        (os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')),
        (os.path.join('share', package_name, 'worlds'), glob('worlds/*.sdf')),
    ] + generate_paths(dir_name="models"),
    install_requires=['setuptools'],
    zip_safe=True,
    maintainer='user',
    maintainer_email='user@todo.todo',
    description='TODO: Package description',
    license='TODO: License declaration',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
        ],
    },
)

Hi @angeloga.rea ,

I think I found the issue in your package:

  1. Gazebo Sim does not support obj files for skin and animation. If the actor model that you are using does not have dae files, then you cannot use that model.
  1. You cannot have character spaces in the file names. Therefore, in your case, the model Walking person will not be detected. Change the directory name from Walking person to WalkingPerson and it should work. Make relevant changes in all the files where you have referenced Walking person to WalkingPerson.

Do the above mentioned changes and let me know if you still have issues.

Regards,
Girish

Thanks for the reply @girishkumar.kannan, but then why I am able to set the env variable IGN_GAZEBO_RESOURCE_PATH to the models folder and I’m able to run gz sim <path_to_world_dir>/final_project.sdf? Both models are created and working as they should, with the animation as well.

Also, I did use that directory name (Walking person) because I tried to debug why could’t Gazebo find it, and seeing the model.config file I saw that the name of the model included the space, and worried if the directory of the model should have the same name as the one used in the config file.

Still, I will try your suggestions and share the results

Done it, still the same issue. Also bare in mind that the Err message says something about Mesh skeleton, so I understand that Walking person was indeed recognized. If I change the filename tags to point to an unknown path such as WalkingPersona the message changes to [ign gazebo-1] [GUI] [Err] [SystemPaths.cc:378] Unable to find file with URI [model://WalkingPersona/meshes/walking.dae] which validates my reasoning, but no clue about what is requesting with the Mesh skeleton err.

Hi @angeloga.rea ,

The name in model.config file has nothing to do with the directory name. This is because the name for a model can have spaces. Whereas the directory that is being referenced to has spaces, then there might be a file referencing issue since some programs need the space character to be escaped with a \ or " or '.

I am not sure how you are doing this since you have not indicated if you are exporting the path in terminal or through the launch file. In both cases, it would work. But if the model is not doing what it should, then there is a file path referencing issue somewhere.

I don’t understand why you tried it with an “unknown” path. It is obviously not going to work and you have also made the debugging case worse by doing some hypothetical stuff which leads to no useful results.

I tested with the same “Walking person” (changed to “WalkingPerson”) and everything works fine for me, at least in my setup. So you have missed something. I don’t like having spaces in my model paths, perhaps that is the reason it is working for me.

Try doing the same changes, but do it from scratch this time and check if that happens again. Try to re-build your packages from scratch by deleting build, install and log folders.

Regards,
Girish

Sorry for the late reply,

I am not sure how you are doing this since you have not indicated if you are exporting the path in terminal or through the launch file. In both cases, it would work. But if the model is not doing what it should, then there is a file path referencing issue somewhere.

If I’m running the gz sim <path_to_world_dir>/final_project.sdf I thought it was obvious that I set the env variable through terminal in that case…

Case without setting the env variable:

Case setting the env variable:

What I am trying to figure out is what the Mesh skeleton error is about. This error is only shown when I run the launch file.

I am not sure how you are doing this since you have not indicated if you are exporting the path in terminal or through the launch file. In both cases, it would work. But if the model is not doing what it should, then there is a file path referencing issue somewhere.

As I said, they are different errors, if I don’t set the model’s path correctly (such as using WalkingPersona inside the xml world instead of WalkingPerson), running ros2 launch final_project final_project.launch.py, the error that prompts is:

[GUI] [Err] [SystemPaths.cc:425] Unable to find file with URI [model://WalkingPersona/meshes/walking.dae]
[GUI] [Err] [SystemPaths.cc:525] Could not resolve file [model://WalkingPersona/meshes/walking.dae]
[GUI] [Err] [MeshManager.cc:193] Unable to find file[model://WalkingPersona/meshes/walking.dae]

Whereas if the model path is set, the error is the next shown:

[GUI] [Err] [SceneManager.cc:979] Mesh skeleton in [model://PatientWheelChair/meshes/PatientWheelChair.obj] not found.
[GUI] [Err] [SceneManager.cc:979] Mesh skeleton in [model://WalkingPerson/meshes/walking.dae] not found.

Once again, I deleted the model and unzipped the model. I saw the model.sdf file and saw that the uri points to a “person_walking” model, so I renamed the directory to person_walking. Still, the same issue happens.

The problem here is simple: if there is a problem referencing the file, why when I have the “mesh skeleton error”, despite the fact that it didn’t spawn succesfully both wheeled and walking actors I’m able to use the plugin “Resource Spawner” in order to spawn moth models, and it does it without any problems?

Also, I downloaded the entire project into my Ubuntu 24 setup with ROS 2 Jazzy. Only changed the IGN_GAZEBO_RESOURCE_PATH for GZ_SIM_RESOURCE_PATH inside the launch file. Ran it and went smooth, both models spawned and animated. I think there is something wrong with the VM built in the course, I have already seen there are some cases where models aren’t included correctly.

My apologies but imho, the response given was vague and didn’t much resolve the issue, I won’t waste more time in this task, since this course doesn’t offer a certificate, and also it works in local environment, don’t know if it due to Gazebo version, or what is the exact problem.

Hi @angeloga.rea ,

Thanks for your detailed explanation and response. Now I was able to understand your situation.
I read through your post a couple of times and have come to the following conclusions:

These are not in any specific order:

  1. The version of Gazebo Ignition installed in the course perhaps does not support the kind of actors that you wish to use. Gazebo Fortress was released quite long back, so was this course. It was a weird time when Fortress and Garden co-existed. The course was initially designed on Fortress and then ported to Garden during release. So there could be some features missing in the course environment.
  2. Maybe the VM is/was faulty. The dependencies were not properly installed and/or were not updated.
  3. The actor files that you used may not have been suitable for Gazebo Fortress version, meaning, the actor files that you used may have implemented something more modern than the specifications needed to run it on Fortress.

If the case is any of the above three, then there is nothing much I can help you with to be honest.

So I suggest you come back to the course when the course has been updated to a modern/latest suitable version.

Regards,
Girish

1 Like

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