sea-bass / turtlebot3_behavior_demos

Example repository for autonomous behaviors using TurtleBot3, as well as Docker workflows in ROS based projects.
MIT License
270 stars 53 forks source link

Not spawned in Gazebo and visualized in RViz #31

Open parkbj26 opened 1 year ago

parkbj26 commented 1 year ago

Always appreciate your kind reply.

Following your recent commit version, I've been retrying to set up this repository by Docker.

Thankfully, the installation doesn't matter due to your last revision, but there are some troubles in the running process.

The below steps are what I've done according to the Readme file in the GitHub repo.

**1. The First Terminal: docker compose up demo-world

  1. The second Terminal: docker compose up demo-behavior-py**

Then, I found messages as shown in the below-captured images.

Screenshot from 2023-04-26 18-45-05 Screenshot from 2023-04-26 18-45-25 Screenshot from 2023-04-26 18-45-50 Screenshot from 2023-04-26 18-45-55

First, there is nothing special in the 1st images.

However, I could find the errors and highlight them in the 2nd and 3rd images.

Also, in the last images, the robot model wasn't spawned, and messages about the service waiting were repeated again and again.

How could I fix these troubles?

sea-bass commented 1 year ago

The ALSA error (image 2) is a non-fatal message (just says no audio playback is available in the container) but the one in image 3 is a potential lead.

Could you maybe include a text file showing the full console output from the service that starts Gazebo? Images of error messages aren't so helpful since I can't scroll up or down on my end.

parkbj26 commented 1 year ago

Thank you for your fast response.

Here are the full outputs in the console involved with the Gazebo.

(base) sandia@sandia-ESC4000-E10:~/bjpark/turtlebot3_behavior_demos$ docker compose up demo-world [+] Running 1/0 ✔ Container turtlebot3_behavior_demos-demo-world-1 Created 0.0s Attaching to turtlebot3_behavior_demos-demo-world-1 turtlebot3_behavior_demos-demo-world-1 | Sourced ROS 2 Humble turtlebot3_behavior_demos-demo-world-1 | Sourced TurtleBot3 base workspace turtlebot3_behavior_demos-demo-world-1 | Sourced autonomy overlay workspace turtlebot3_behavior_demos-demo-world-1 | [INFO] [launch]: All log files can be found below /root/.ros/log/2023-04-26-10-31-11-060798-sandia-ESC4000-E10-1 turtlebot3_behavior_demos-demo-world-1 | [INFO] [launch]: Default logging verbosity is set to INFO turtlebot3_behavior_demos-demo-world-1 | urdf_file_name : turtlebot3_waffle_pi.urdf turtlebot3_behavior_demos-demo-world-1 | [INFO] [component_container_isolated-1]: process started with pid [81] turtlebot3_behavior_demos-demo-world-1 | [INFO] [rviz2-2]: process started with pid [83] turtlebot3_behavior_demos-demo-world-1 | [INFO] [set_init_amcl_pose.py-3]: process started with pid [85] turtlebot3_behavior_demos-demo-world-1 | [INFO] [block_spawner.py-4]: process started with pid [87] turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505073.593727855] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [rviz2-2] [INFO] [1682505073.609455357] [rviz2]: Stereo is NOT SUPPORTED turtlebot3_behavior_demos-demo-world-1 | [rviz2-2] [INFO] [1682505073.609848149] [rviz2]: OpenGl version: 4.5 (GLSL 4.5) turtlebot3_behavior_demos-demo-world-1 | [rviz2-2] [INFO] [1682505073.703330262] [rviz2]: Stereo is NOT SUPPORTED turtlebot3_behavior_demos-demo-world-1 | [rviz2-2] [WARN] [1682505073.785998149] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505074.596161412] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505074.631613842] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505075.598692294] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505075.634721226] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | urdf_file_name : turtlebot3_waffle_pi.urdf turtlebot3_behavior_demos-demo-world-1 | urdf_file_name : turtlebot3_waffle_pi.urdf turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505076.601203588] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505077.603732415] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505076.637771241] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [INFO] [gzserver-5]: process started with pid [169] turtlebot3_behavior_demos-demo-world-1 | [INFO] [gzclient-6]: process started with pid [171] turtlebot3_behavior_demos-demo-world-1 | [INFO] [robot_state_publisher-7]: process started with pid [173] turtlebot3_behavior_demos-demo-world-1 | [INFO] [spawn_entity.py-8]: process started with pid [175] turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505077.640907153] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645323423] [robot_state_publisher]: got segment base_footprint turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645432264] [robot_state_publisher]: got segment base_link turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645444741] [robot_state_publisher]: got segment base_scan turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645452139] [robot_state_publisher]: got segment camera_link turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645459977] [robot_state_publisher]: got segment camera_rgb_frame turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645467348] [robot_state_publisher]: got segment camera_rgb_optical_frame turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645474913] [robot_state_publisher]: got segment caster_back_left_link turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645481729] [robot_state_publisher]: got segment caster_back_right_link turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645488781] [robot_state_publisher]: got segment imu_link turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645495752] [robot_state_publisher]: got segment wheel_left_link turtlebot3_behavior_demos-demo-world-1 | [robot_state_publisher-7] [INFO] [1682505077.645502936] [robot_state_publisher]: got segment wheel_right_link turtlebot3_behavior_demos-demo-world-1 | [spawn_entity.py-8] [INFO] [1682505077.924686619] [spawn_entity]: Spawn Entity started turtlebot3_behavior_demos-demo-world-1 | [spawn_entity.py-8] [INFO] [1682505077.925129799] [spawn_entity]: Loading entity XML from file /turtlebot3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.sdf turtlebot3_behavior_demos-demo-world-1 | [spawn_entity.py-8] [INFO] [1682505077.926341425] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30 turtlebot3_behavior_demos-demo-world-1 | [spawn_entity.py-8] [INFO] [1682505077.926733042] [spawn_entity]: Waiting for service /spawn_entity turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505078.606259491] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505078.644050110] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [gzserver-5] ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave turtlebot3_behavior_demos-demo-world-1 | [gzserver-5] AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505079.607884323] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505079.647226674] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505080.610385276] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505080.650298411] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505081.611915325] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505081.653364660] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505082.614525505] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505082.656390413] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505083.617067062] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505083.659562445] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505084.619600219] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505084.662715177] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505085.622123594] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505085.665819895] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505086.624648955] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505086.669009652] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505087.627185035] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505087.671958452] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505088.629692802] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505088.675109712] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505089.632056997] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505089.678281433] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505090.634610450] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505090.681662564] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505091.637118212] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505091.684851910] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505092.639010066] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505092.687967484] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505093.641503051] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505093.691263641] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505094.644009251] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505094.694350588] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505095.646564730] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505095.697673209] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505096.649072798] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505096.700765804] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505097.651725399] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505097.703953186] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505098.654337303] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505098.707180367] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505099.655931451] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505099.710370156] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505100.658566215] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505100.713457345] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505101.661099682] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505101.716482560] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505102.663656578] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505102.719664801] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505103.666269183] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505103.722892959] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505104.667895043] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505104.726064129] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505105.670461123] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505105.729147626] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505106.673134232] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505106.732315007] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505107.675661707] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505107.735529032] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [spawn_entity.py-8] [ERROR] [1682505107.977209183] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? turtlebot3_behavior_demos-demo-world-1 | [spawn_entity.py-8] [ERROR] [1682505107.978217891] [spawn_entity]: Spawn service failed. Exiting. turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505108.678289348] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505108.738681129] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505109.680864962] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505109.741794783] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505110.683397277] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505110.744723541] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505111.685906630] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505111.747686405] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505112.688452232] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505112.750750648] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505113.690752587] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505113.753796959] [block_spawner]: Waiting for service... turtlebot3_behavior_demos-demo-world-1 | [set_init_amcl_pose.py-3] [INFO] [1682505114.693248077] [init_pose_publisher]: Waiting for AMCL Initial pose subscriber turtlebot3_behavior_demos-demo-world-1 | [block_spawner.py-4] [INFO] [1682505114.756939703] [block_spawner]: Waiting for service...

sea-bass commented 1 year ago

Hmm... it might be that there is already an orphaned Gazebo process somewhere else on your system.

Could you run docker compose down -v --remove-orphans, then check docker ps that nothing is active, and try starting up again?

And you don't have any Gazebo processed hanging around your host system either, right?

parkbj26 commented 1 year ago

I've tried it again from the first step according to your comment, but unfortunately, it didn't work.

I guess that there is something wrong with the spawning of the Turtlebot model because I found that the only Turtlebot simulation doesn't work when I typed the console like the below line.

ros2 launch Turtlebot3_gazebo turtlebot3_house.launch.py

It also showed the same error message like the following :

[spawn_entity.py-8] [ERROR] [1682505107.977209183] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? [spawn_entity.py-8] [ERROR] [1682505107.978217891] [spawn_entity]: Spawn service failed. Exiting.

So, I googled the issue about the 'Was Gazebo started with GazeboRosFactory?' thing in order to address it.

The conclusion is that it seemed like a kind of trouble because of the existing gazebo server already.

I've tried to figure out how to kill all nodes of the gazebo, but the console stopped and showed nothing whenever I type 'ros2 node list'.

So, I want to ask you if I'm following you in the right way to run the demo. Are the following steps correct?

  1. git clone https://github.com/sea-bass/turtlebot3_behavior_demos.git
  2. cd turtlebot3_behavior_demos
  3. docker compose build
  4. docker compose up demo-world
  5. (In new terminal) docker compose up demo-behavior-py

I appreciate your comment if I'm missing something.

sea-bass commented 1 year ago

If the lingering Gazebo instance is on your host, you can look for the gzserver and gzclient processes.

For example, killall gzserver gzclient if you have that tool

li9i commented 9 months ago

I've tried it again from the first step according to your comment, but unfortunately, it didn't work.

I guess that there is something wrong with the spawning of the Turtlebot model because I found that the only Turtlebot simulation doesn't work when I typed the console like the below line.

ros2 launch Turtlebot3_gazebo turtlebot3_house.launch.py

It also showed the same error message like the following :

[spawn_entity.py-8] [ERROR] [1682505107.977209183] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory? [spawn_entity.py-8] [ERROR] [1682505107.978217891] [spawn_entity]: Spawn service failed. Exiting.

So, I googled the issue about the 'Was Gazebo started with GazeboRosFactory?' thing in order to address it.

The conclusion is that it seemed like a kind of trouble because of the existing gazebo server already.

I've tried to figure out how to kill all nodes of the gazebo, but the console stopped and showed nothing whenever I type 'ros2 node list'.

So, I want to ask you if I'm following you in the right way to run the demo. Are the following steps correct?

  1. git clone https://github.com/sea-bass/turtlebot3_behavior_demos.git
  2. cd turtlebot3_behavior_demos
  3. docker compose build
  4. docker compose up demo-world
  5. (In new terminal) docker compose up demo-behavior-py

I appreciate your comment if I'm missing something.

You may try to source /usr/share/gazebo/setup.sh in your entrypoint. This fixed it for me.

@sea-bass thank you very much for this repository and your articles. They helped me understand stuff that I had questions about.

Jannick52 commented 5 months ago

I am facing the exact same problem as the original poster of this issue. The gazebo world loads but the turtlebot model does not appear. I digged into this quite a bit but still haven't been able to make it work. First of all, I made sure that GAZEBO_MODEL_PATH was correctly set as some people on the internet suggested, but that did not make a difference. The suggestion above to source /usr/share/gazebo/setup.sh unfortunately also does not help. There seems to be a problem with the /spawn_entity service which is supposed to spawn the turtlebot3 waffle pi model into the gazebo simulation. Furthermore, the standard gazebo topics (e.g. /clock) are not being published to the ROS2 topics when listing them with ros2 topic list. After manually dropping a turtlebot3 robot into the simulation the expected topics such as odom_vel also do not show up. This leads me to believe that there is an issue with the connection between ROS2 and gazebo, but I have not been able to figure out what is causing this. With the current setup we are using ROS2 humble with gazebo classic 11.10.2, which should be compatible according to the documentation.

Any help would be appreciated, I would love to make use of this neat setup you have created. Thanks!

Jannick52 commented 5 months ago

I found out that the issue for me was being caused by the Cyclone DDS middleware. After commenting out the relevant lines to revert to the default RMW implementation everything seems to be working fine. The robot is now spawning and the gazebo topics are being published to ROS2.