Unable to find uri[model://my1stmodel]

asked 2021-02-21 11:22:27 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


I have a problem visualizing my custom model in Gazebo using ROS. The model is working fine if I manually add it by adding a path and dragging it from the model's tab.

To reproduce the problem step by step (using theconstructsim tutorial here, I created a simple rospack just to visualize the custom model. The directory looks like:

├── CMakeLists.txt
├── package.xml
├── launch
│   └── my_world.launch
├── models
│   └── my1stmodel
│       ├── model.config
│       └── model.sdf
└── world
    └── empty_world.world

In the launch file:

<?xml version="1.0" encoding="UTF-8" ?>
        <!-- overwriting these args -->
        <arg name="debug" default="false" />
        <arg name="gui" default="true" />
        <arg name="pause" default="false" />
        <arg name="world" default="$(find test_simulations)/world/empty_world.world" />

        <!-- include gazebo_ros launcher -->
        <include file="$(find gazebo_ros)/launch/empty_world.launch">
                <arg name="world_name" value="$(arg world)" />
                <arg name="debug" value="$(arg debug)" />
                <arg name="gui" value="$(arg gui)" />
                <arg name="paused" value="$(arg pause)" />
                <arg name="use_sim_time" value="true" />

The model.config file:

<?xml version="1.0"?>

  <name>My first model</name>
  <sdf version="1.5">model.sdf</sdf>

    <name>Your name</name>

    My first model for gazebo

And finally the model.sdf file:

<?xml version="1.0" ?>
<sdf version="1.5">
  <model name="my1stmodel">
    <link name="link">
      <collision name="collision">
            <size>3 2 5</size>
      <visual name="visual">
            <size>3 2 5</size>


However, I cannot visualize the model and I get Unable to find uri[model://my1stmodel] when I call the launch file. After a deep search the whole day, I saw that export GAZEBO_MODEL_PATH=[...]/models:$GAZEBO_MODEL_PATH might have been added. I tried and didn't work. Then I've found people saying this shouldn't work for Gazebo on ROS.

Then I tried adding manually, like adding the path to the models tab and dragging from there, and then saving the world (with save as). I was hoping to see that I missed some folder or name error while calling the model. What I see is that the Gazebo-exported world has also added my custom model in the same way. So, I am solutionless at the moment. I can see that I cannot call the model properly but I don't see where I am wrong.

Thank you in advance

edit retag flag offensive close merge delete