0
$\begingroup$

Rosanswers logo

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 model://my_maze 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.


Originally posted by dhos on ROS Answers with karma: 3 on 2022-04-18

Post score: 0


Original comments

Comment by aarsh_t on 2022-04-19:
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

Comment by ljaniec on 2022-04-19:
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 your building_editor_models folder isn'a added to the GAZEBO_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.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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>

[Edit]

  • echo "export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$HOME/catkin_ws/src/" >> ~/.bashrc

NOTE: I am using this tutorial as a referance. if there is any typo PLMK

[Continue from comment]

  • echo "export GAZEBO_RESOURCE_PATH=$GAZEBO_RESOURCE_PATH:$HOME/catkin_ws/src/my_pkg/worlds" >> ~/.bashrc

[Edit-2]

one more way is to do it in launch file if you do not want to do export all the time and not want to add it to bashrc as well. something like this,

<env name="GAZEBO_MODEL_PATH" value="$(find my_pkg)/models:$(optenv GAZEBO_MODEL_PATH)"/>

<env name="GAZEBO_RESOURCE_PATH" value="$(find my_pkg)/worlds:$(optenv GAZEBO_RESOURCE_PATH)"/>


Originally posted by aarsh_t with karma: 328 on 2022-04-19

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

This is most likely a better question for https://answers.gazebosim.org/questions/ - in the future I suggest you direct your Gazebo questions there. But the most likely culprit is that you simply haven't added your package's models folder to the Gazebo model path.

export GAZEBO_MODEL_PATH=/path/to/my/package/models/:$GAZEBO_MODEL_PATH

If you have done this and still don't see your models, I would recommend either:

  • looking in your Gazebo server log for details (located in the hidden .gazebo folder, by default: ~/.gazebo/server-XXXXX/default.log where XXXXX is the Gazebo Master URI port number). This should tell you
  • running Gazebo in "verbose" mode to print out relevant error messages. gazebo --verbose path/to/my/world.world

Originally posted by shonigmann with karma: 1567 on 2022-04-19

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.