Skip to main content
edited body
Source Link
Kedar
  • 23
  • 6
  1. Models
  2. Box
    • model.config
    • model.sdf
    • meshes(folder)
      • mesh1.dae
      • mesh2.stl
      • mesh3.stl
  • Models
    • Box
      • model.config
      • model.sdf
      • meshes(folder)
        • mesh1.dae
        • mesh2.stl
        • mesh3.stl
  1. Models
  2. Box
    • model.config
    • model.sdf
    • meshes(folder)
      • mesh1.dae
      • mesh2.stl
      • mesh3.stl
  • Models
    • Box
      • model.config
      • model.sdf
      • meshes(folder)
        • mesh1.dae
        • mesh2.stl
        • mesh3.stl
deleted 23 characters in body
Source Link
Kedar
  • 23
  • 6

Spawn nr2_6dof_arm

Spawn nr2_6dof_arm

added 2115 characters in body
Source Link
Kedar
  • 23
  • 6

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

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

below is the info inside present in the all the files.

a. Model.config file

  <?xml version="1.0"?>
  <model>
    <name>Box</name>
    <version>1.0</version>
    <sdf version='1.6'>model.sdf</sdf>
 <author>
<name>name</name>
<email>[email protected]</email>
</author>
<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>
<static>true</static>
<link name="link">
  <collision name="collision">
    <geometry>
      <mesh>
        <uri>model://box/meshes/mesh1.dae</uri>
        <scale>0.25 0.25 0.25</scale>
      </mesh>
    </geometry>
  </collision>
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://box/meshes/mesh1.dae</uri>
        <scale>0.25 0.25 0.25</scale>
      </mesh>
    </geometry>
  </visual>
</link>

c. How to use the Launch File in python

Spawn nr2_6dof_arm

spawn_entity = Node(package='gazebo_ros',
                    executable='spawn_entity.py',
                    name="spawn_sdf_entity",
                    arguments=[ '-entity','Box','-file', LaunchConfiguration('sdf_model'),
                                '-x','1.0',
                                '-y','1.0',
                                '-z', '0.0',
                                '-R','0.0',
                                '-P','0.0',
                                '-Y','0.0'
                                ], output='screen')


return LaunchDescription([
    sdf_model,
    spawn_entity,
])

I hope this will be useful for everyone!!

1.Create a Models Folder in your Directory and store the

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

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

below is the info inside present in the all the files.

a. Model.config file

  <?xml version="1.0"?>
  <model>
    <name>Box</name>
    <version>1.0</version>
    <sdf version='1.6'>model.sdf</sdf>
 <author>
<name>name</name>
<email>[email protected]</email>
</author>
<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>
<static>true</static>
<link name="link">
  <collision name="collision">
    <geometry>
      <mesh>
        <uri>model://box/meshes/mesh1.dae</uri>
        <scale>0.25 0.25 0.25</scale>
      </mesh>
    </geometry>
  </collision>
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://box/meshes/mesh1.dae</uri>
        <scale>0.25 0.25 0.25</scale>
      </mesh>
    </geometry>
  </visual>
</link>

c. How to use the Launch File in python

Spawn nr2_6dof_arm

spawn_entity = Node(package='gazebo_ros',
                    executable='spawn_entity.py',
                    name="spawn_sdf_entity",
                    arguments=[ '-entity','Box','-file', LaunchConfiguration('sdf_model'),
                                '-x','1.0',
                                '-y','1.0',
                                '-z', '0.0',
                                '-R','0.0',
                                '-P','0.0',
                                '-Y','0.0'
                                ], output='screen')


return LaunchDescription([
    sdf_model,
    spawn_entity,
])

I hope this will be useful for everyone!!

added 83 characters in body
Source Link
Kedar
  • 23
  • 6
Loading
deleted 23 characters in body
Source Link
Kedar
  • 23
  • 6
Loading
added 1 character in body
Source Link
Kedar
  • 23
  • 6
Loading
Source Link
Kedar
  • 23
  • 6
Loading