Robotics StackExchange | Archived questions

Loading a URDF file from a World Plugin (gazebo without ROS)

Hi,

I am using gazebo to perform some robotics simulations. To this purpose I am using a Model Plugin to control my model and want to use a World Plugin to spawn the scenario of the simulation. Doing it this will allow me in the future to easily run several different scenario easily.

The problem is that my models are .urdf files and it seems that the Wolrd class only allows to insert .sdf files.

I tried using commands like gz sdf -p to convert the files but without succes, when I try to load them I always get this kind of errors while testing the spawn with gz model

[Err] [RenderEngine.cc:484] URI doesn't exist[package://robot/model/materials/scripts/robot.material]

or

[Err] [ModelDatabase.cc:414] Unable to download model[model://robot/model/meshes/Waist.STL]

The corresponding lines in the .urdf would be:

   <gazebo reference="Leg">
    <visual>
      <material>
        <script>
          <uri>package://robot/model/materials/scripts/robot.material</uri>
          <name>robot/darkgrey</name>
        </script>
      </material>
    </visual>
  </gazebo>

and

<geometry name="Waist_visual">
    <mesh filename="package://robot/model/meshes/Waist.STL" scale="0.03937 0.03937 0.03937"/>
  </geometry>

It should be noted that the models were previously spawned with ROS, but I decided to stop using it and only use the gazebo API which is less heavy to use.

Do you know if there is a way of directly spawning .urdf models with a World Plugin or if not a way of doing it without ROS?

Thanks for your help!

Asked by kincurt on 2018-11-15 09:41:53 UTC

Comments

I didn't mention, I run with gazebo 7.14

Asked by kincurt on 2018-11-15 17:50:59 UTC

Answers

The Problem is related to the answer of this question

In addition: you are using the keyword package: which is related to ROS Packages. Gazebo can't use them. I recommend you to export your GAZEBO_MODEL_PATH and change the "package:" to "model:"

export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/path/to/your/package

Asked by wentz on 2018-11-16 09:26:09 UTC

Comments

Thank you!!!!!!!

Asked by JeBear76 on 2022-09-23 06:14:44 UTC