problems loading models in gazebo
I have a problem with my maze, simply when I start the world it appears empty, even though I defined the location of the models inside the .world file in my packages in Catkin's Workspace like </include> <url>model://my_maze</url> </include> I tried to change the location of the folder where my package is to the gazebo folder and still the items do not load,just appears the turtlebot3 in a empty world, can someone help me, it would be for a final project at my college.
Can you specify which file are you launching for the turtlebot and if possible can you provide the world file and the launch files? Thanks
I will still mention the procedure to use custom world in the gazebo, (I assume your pkg is at
~/catkin_ws/src/my_pkg
)mkdir ~/catkin_ws/src/my_pkg/worlds
cd ~/catkin_ws/src/my_pkg/worlds
touch my_world.world
Put all your models in the world file (you can use various mesh formats like .dae .stl or even robot format .urdf)
To be able to use the custom models from
~/catkin_ws/src/my_pkg/models
you need to put this in your~/catkin_ws/src/my_pkg/package.xml
<run_depend>gazebo_ros</run_depend> <export> <gazebo_ros gazebo_model_path="${prefix}/models"/> <gazebo_ros gazebo_media_path="${prefix}/models"/> </export>
echo "export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$HOME/catkin_ws/src/"
NOTE: I am using this tutorial as a referance. if there is any typo PLMK
You can copy & paste your model of the labyrinth in your
/home/${USER}/.gazebo/models
and then create a world with it inside (Gazebo should have this model loaded then). Maybe yourbuilding_editor_models
folder isn'a added to theGAZEBO_MODEL_PATH
too (e.g. in~/.bashrc
like this:export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/model_editor_models
). Suggestions from @aarsh_t and @shonigmann are good too, please check them.