Gazebo | Ignition | Community
Ask Your Question
0

[GUI] [Err] [SystemPaths.cc:425] Unable to find file with URI [model://model_pkg/models/base.dae]

asked 2023-02-23 11:01:08 -0500

ryn gravatar image

updated 2023-02-23 11:04:33 -0500

Im trying to load an sdf of a model in a project structure like this:

src/
  model_pkg/
    urdf/
      diff_bot.sdf
      diff_bot.xml
    models/
      base.dae

with this this sdf:

<sdf version='1.10'>
  <model name='diff_bot'>
    <link name='base_link'>
      <inertial>
        <pose>0 0 0 0 0 0</pose>
        <mass>0.010288200184753521</mass>
        <inertia>
          <ixx>9.2e-05</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>4.8999999999999998e-05</iyy>
          <iyz>0</iyz>
          <izz>0.000111</izz>
        </inertia>
      </inertial>
      <visual name='base_link_visual'>
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <mesh>
            <scale>1 1 1</scale>
            <uri>model://model_pkg/models/base.dae</uri>
          </mesh>
        </geometry>
      </visual>
    </link>
  </model>
</sdf>

with this bash script:

#!/bin/bash

export GAZEBO_MODEL_PATH=<insert path to project here>/src/model_pkg/models:
export GAZEBO_RESOURCE_PATH=<insert path to project here>/src/model_pkg/models:

gz sim <insert path to project here>/src/model_pkg/urdf/diff_bot.sdf

However, when I try to load the model with the .bash script, I get the error in the title, and other errors all relating to not being able to find the model, base.dae. Every post ive found thus far has said editing gazebo paths to lead to the model's location would fix the error(s), but editing the bash script to export GAZEBO_MODEL_PATH and GAZEBO_RESOURCE_PATH hasn't fixed that for me.

Is there something I'm missing?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-02-24 10:52:05 -0500

azeey gravatar image

The GAZEBO_RESOURCE_PATH variable is used for Gazebo-classic. For Gazebo Garden, you need to set GZ_SIM_RESOURCE_PATH. It also needs to be the path of a directory such that starting from that directory, model_pkg/models/base.dae is valid. You can think of model:// as being replaced by one of the directories in GZ_SIM_RESOURCE_PATH. See https://gazebosim.org/api/sim/7/resou... for more details.

edit flag offensive delete link more

Comments

editing my bash script to be:

#!/bin/bash

killall ruby

export GZ_SIM_RESOURCE_PATH=/home/rydb/Projects/ROS2_easy/src:

gz sim /home/rydb/Projects/ROS2_easy/src/model_pkg/urdf/diff_bot.sdf

allowed the model to load. Also, the help command for gazebo simulation, for garden, gz sim -h lists env variables at the bottom. GZ_SIM_RESOURCE_PATH might no longer work one day so look for the equivalent env variable if y'all get stuck via your gazebo's help command

ryn gravatar imageryn ( 2023-02-24 11:23:06 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2023-02-23 11:01:08 -0500

Seen: 408 times

Last updated: Feb 24