Problem spawning model in Gazebo

asked 2022-03-14 14:14:32 -0600

joseecm gravatar image

Hi there,

I have a problem spawning model in Gazebo. Until now I was able to spawn models without problem from my launch files. Today I have instaled the package aws_robomaker_small_warehouse_world, and I don't not if there is any relation but after that spawning models doesn't work and I get the message "[spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory?" It only works if I previously execute:

 . /usr/share/gazebo/setup.sh

What could have happened and how can I fix it?

Thanks in advance for your help.

edit retag flag offensive close merge delete

Comments

What do you get with gazebo --verbose? Are services calls [/shadow_caster_material_name] and [/shadow_caster_render_back_faces] timed out?

ljaniec gravatar image ljaniec  ( 2022-03-14 14:35:47 -0600 )edit

I'm just becaming to learn Gazebo. I use the following lines of code to execute gazebo. Please, could you tell me how to include the --verbose option in the code?

gazebo = IncludeLaunchDescription(
            PythonLaunchDescriptionSource([os.path.join(
                get_package_share_directory('gazebo_ros'), 'launch'), '/gazebo.launch.py']),
         )
joseecm gravatar image joseecm  ( 2022-03-14 16:08:40 -0600 )edit

Use it in the terminal: gazebo --verbose

ljaniec gravatar image ljaniec  ( 2022-03-14 16:31:11 -0600 )edit

I have use gazebo --verbose and it doesn't show any error. But I have check using env | grep GAZEBO that there aren't environment variables related to Gazebo. Is that normal?

joseecm gravatar image joseecm  ( 2022-03-15 06:20:33 -0600 )edit

I have some GAZEBO_* variables in my environment: GAZEBO_MASTER_URI, GAZEBO_PLUGIN_PATH, GAZEBO_MODEL_DATABASE_URI, GAZEBO_RESOURCE_PATH and GAZEBO_MODEL_PATH. Do you have

stat /usr/share/gazebo/setup.sh &> /dev/null
if [ $? -eq 0 ]; then
    source /usr/share/gazebo/setup.sh
fi

in your ~/.bashrc?

ljaniec gravatar image ljaniec  ( 2022-03-15 06:43:30 -0600 )edit

After reinstalling Gazebo it works again. However, in my .bashrc file the code lines you indicate do not appear and if I execute env | grep GAZEBO also does not show any environment variables associated with GAZEBO. So I don't know what was going on.

joseecm gravatar image joseecm  ( 2022-03-15 12:00:19 -0600 )edit

Just to be clear - the code in ~/.bashrc was for sourcing the Gazebo without doing it by hand, I had pasted it it there myself. It was a solution for some Gazebo problems which I don't remember now :)

ljaniec gravatar image ljaniec  ( 2022-03-15 12:55:05 -0600 )edit