Gazebo | Ignition | Community
Ask Your Question
1

How to use a custom mesh in .world file

asked 2014-06-24 14:54:06 -0600

JoSo gravatar image

updated 2014-06-24 14:59:05 -0600

Hi all, This is low level, as I am a noob at Gazebo and ROS. I follow the custom world build tutorial http://gazebosim.org/wiki/Tutorials/1.9/UsingroslaunchFilestoSpawn_Models just fine and create a gas station but I want to sub in a custom mesh. The mesh was created in MeshLab from a .stl and I exported it as a .dae file to the /models folder in my gazebo package. The code is below for the world file, I simply replaced

<uri>model://gas_station</uri>

with

<mesh><uri>file://~/catkinws/src/iarmgazebo/models/HardHat.dae</uri></mesh>

but I'm not sure if this is the right format or if the file needs to be in a different folder for it to be scene. Perhaps I need to modify my package.xml or CMakeLists.txt or source something to recognize it. The full file is below along with the error produced when I run

gazebo iarm.world

from my package path

> <?xml version="1.0" ?>
<sdf version="1.4">
  <world name="default">
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <include>
      <uri>model://sun</uri>
    </include>
    <model name="hardhat">
       <pose>0 0 0  0 0 0</pose>
      <static>true</static>
      <link name="body">
        <visual name="visual">
          <geometry>
            <mesh><uri>file://~/catkin_ws/src/iarm_gazebo/models/HardHat.dae</uri></mesh>
          </geometry>
        </visual>
      </link>
    </model>
  </world>
</sdf>

The error:

> Error [SystemPaths.cc:371] File or path does not exist[""]
Error [Visual.cc:2072] No mesh specified

Any and all help is appreciated. Kinda need to spell it out for me. Thanks for your time, guys.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-06-24 15:07:18 -0600

JoSo gravatar image

Sorry guys, answered my own question. I only needed the line to be

<mesh><uri>file://HardHat.dae</uri></mesh>

and have the file inside my /worlds folder with my .world xml

Thanks. Don't worry there will be plenty of other stupid questions to answer!

edit flag offensive delete link more

Comments

I believe a full system path would have also worked, file:///home/foo/worlds/bar.dae, just not the tilde, and maybe have worked from roslaunch also- but no package:// support which would be nice.

Lucas Walter gravatar imageLucas Walter ( 2014-12-03 16:27:53 -0600 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-06-24 14:54:06 -0600

Seen: 2,954 times

Last updated: Jun 24 '14