ROS2 Navigation Unit 5 - Gazebo Simulation error

I’m doing exercise 5.1 of unit 5, when I execute the commands to make a cone appear in the gazebo simulation I get the following error:

user:~$ source /home/simulations/ros2_sims_ws/install/setup.bash
user:~$ ros2 run gazebo_ros -entity construction_cone -database construction_cone
[INFO] [1702487960.467903655] [spawn_entity]: Spawn Entity started
[INFO] [1702487960.468717112] [spawn_entity]: Loading entity XML from Gazebo Model Database
[INFO] [1702487960.470067734] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[INFO] [1702487960.470870991] [spawn_entity]: Waiting for service /spawn_entity
[ERROR] [1702487990.601374160] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory?
[ERROR] [1702487990.602828003] [spawn_entity]: Spawn service failed. Exiting.
[ros2run]: Process exited with failure 1

Hi @kevpretell

Can your please also share python code here

the only commands to execute to make the cone appear in the gazebo simulation are:

source /home/simulations/ros2_sims_ws/install/setup.bash
ros2 run gazebo_ros -entity construction_cone -database construction_cone

(obviously I launched all the path planning nodes first as mentioned in the notebook)

Hi @kevpretell,
I have the same issue than you when I try to follow the instruction of the notebook.
By looking in default.log file by doing $cd ~/.gazebo/ and open with vi the default.log file, I have these logs:

(1702509557 928853512) [Wrn] [] URI not supported by Fuel [model://construction_cone]
(1702509557 928895069) [Wrn] [] File or path does not exist [""] [model://construction_cone]
(1702509561 145562657) [Wrn] [] Getting models from[]. This may take a few seconds.
(1702509691 52720936) [Wrn] [] Unable to connect to model database using []. Only locally installed models will be available.

It seems that the ROS environement of the project is not able to connect to the model database ( It should be possible to spawn models already present in the local installation.

1 Like

@EnzoGhisoni I saw, did you manage to solve it?

@kevpretell the /spawn_entity service is offered by Gazebo, so it seems weird that it’s not available. Can you see it if you list the services?

@roalgoal the service is not present in the list :face_with_diagonal_mouth:

Ok, I noticed that this happens in the newer Humble version, while Galactic version works.

Thank you for bringing it to our attention. We’ll work on that fix.

In the meantime, you can skip that part.

The spawning of the cone is used to illustrate the local_costmap in action, in order to avoid an obstacle that is not defined in the map created.

Once you configure it and launch it, then you can see if the costmap is working by looking at it through rviz2.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.