0
$\begingroup$

Gazebo Answers logo

I created a simple .world file:

<?xml version="1.0"?>
<sdf version="1.4">
    <world name="office">
        <include>
            <uri>model://sun</uri>
        </include>

        <include>
            <uri>model://ground_plane</uri>
        </include>
    </world>
</sdf>

My launch file also adds a robot to this world. It launches fine in gazebo, I can see the gray ground plane with grid markings on it and also my robot. image description

Next I created a simple building layout (some walls created using Gazebo's building editor). I saved the building model and added these lines to my .world file:

<include>
    <uri>model://car_description/models/tunnel</uri>
    <pose>25 20.2 0 0 0 0</pose>
</include>

When I launch the file again, this time it takes ages to launch. I see a 'Preparing your world ...' screen for a long time (~10 mins): image description

and then I see this dark screen:

image description

Other solutions which I have tried and did not work for me are:

  1. Adding the following code to the package's package.xml

     <export>
        <gazebo_ros gazebo_model_path="${prefix}/models"/>
           <gazebo_ros gazebo_media_path="${prefix}/models"/>
     </export>
    
  2. Adding the environment variable GAZEBO_MODEL_PATHto my .bashrc file:

     export GAZEBO_MODEL_PATH=/home/my_user/my_catkin_ws/src/
    

There are no errors thrown in the terminal. What am I doing wrong?


Originally posted by Subodh Malgonde on Gazebo Answers with karma: 31 on 2018-08-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

I placed the model files in the ~/.gazebo/models directory and changed the code in the .world file to:

<include>
    <uri>model://tunnel</uri>
    <pose>25 20.2 0 0 0 0</pose>
</include>

Its working fine now. However I still don't know how to provide a reference to models which are not in the ~/.gazeo/models directory.


Originally posted by Subodh Malgonde with karma: 31 on 2018-08-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Raskkii on 2018-08-13:
What is the output of "echo $GAZEBO_MODEL_PATH"?

Comment by Subodh Malgonde on 2018-08-23:
This environment variable is not set by ROS. So the output is blank. After I set it in .bashrc, I get the output. However it did not fix my problem.

Comment by Raskkii on 2018-08-23:
Try changing the command set in .bashrc slightly: export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/home/my_user/my_catkin_ws/src/ The difference here is that this adds your custom path to the existing model path (which should be ~/.gazebo/models) and doesn't overwrite it, allowing both paths to be used.

$\endgroup$

Your Answer

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