I have created an Object using Blender and was able to add the Add to the Path File in Ros Humble Gazebo it worked, how to open the same SDF file using Python Launch file.


1 Answer 1


Solution: Steps to Follow:

1.Create a Models Folder in your Directory(package file) and store the sdf file there. I have created a single Folder named Box inside the Models File

  • Models
    • Box
      • model.config
      • model.sdf
      • meshes(folder)
        • mesh1.dae
        • mesh2.stl
        • mesh3.stl

a. Model.config file

  <?xml version="1.0"?>
    <sdf version='1.6'>model.sdf</sdf>
<email>[email protected]</email>
<description>This is a box</description>
b. model.sdf
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="Box">
<pose>0 0 0 0 0 0</pose>
<link name="link">
  <collision name="collision">
        <scale>0.25 0.25 0.25</scale>
  <visual name="visual">
        <scale>0.25 0.25 0.25</scale>

c. How to use the Launch File in python

spawn_entity = Node(package='gazebo_ros',
                    arguments=[ '-entity','Box','-file', LaunchConfiguration('sdf_model'),
                                '-z', '0.0',
                                ], output='screen')

return LaunchDescription([

I hope this will be useful for everyone!!


ROS2 Humble Linux ubuntu 22


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.