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': [
],
},
)