Unit5 - exercise 5.1 - can not spawn construction_cone


I can not spawn construction_cone:

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

After running this command I get:

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

I tried this with -timeout 180, but same issue.
I tried spawning coke_can, same issue.

I tried modifying turtlebot3_tc_world.launch.py in
with adding -s libgazebo_ros_factory.so when starting the simulation:

            cmd=['gazebo', '--verbose', world, '-s', 'libgazebo_ros_init.so', '-s', 'libgazebo_ros_factory.so'],

and restarting the simulation.
(Probably it was not a good idea because simulation did not start then something put the original launch file back so the simulation is ok now but not the spawning of the construction_cone)

Can someone help me with the spawning issue?

Thank you in advance

We are looking into it. But there is an issue for sure, we will try to find a solution. Sorry about the inconvenience. As soon as I have a solution ate least for you fast I’ll let you know here.

1 Like

I keep this question open with this message.

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