Robotics StackExchange | Archived questions

Gazebo first load slow to load in container (controller spawner fails)?

Hi everyone. I'm trying to spin up a few containers that will launch a simulation of a UR5e in Gazebo. When I run the container and launch my launch file, the controller spawner complains and ultimately fails to find the Gazebo interface. The odd thing is if I kill the roslaunch command and do it again, everything runs fine. I hypothesize that gazebo needs to initialize or something and takes longer the first time it comes up. I tried a bash script that runs the roslaunch, then kills it x seconds later and runs again, but it doesn't feel right.

Is my hypothesis correct? Is there a way to wait for gazebo to be ready in a launch file?

Log file is here, but this is the first relevant error, I think:

0.000000000 WARN /controller_spawner [spawner:138(main)] [topics: /clock, /rosout] Controller Spawner couldn't find the expected controller_manager ROS interface.

I'm using the image here: osrf/ros:melodic-desktop-full which includes Gazebo 9

To reproduce, have docker installed on a host and run:

docker run -it jdekarske/homestri-remote-experiment:latest

Then, in the container run:

roslaunch experiment_world main_experiment.launch rviz_gui:=false gazebo_gui:=false

Github Repo

Thank you for any help :)

Asked by jdekarske on 2020-11-15 21:07:42 UTC

Comments

Can't attach with low points. Logs here: https://pastebin.com/9DNXhUeM

Asked by jdekarske on 2020-11-15 21:41:04 UTC

bump, please help

Asked by jdekarske on 2020-12-08 01:14:03 UTC

Answers

Figured it out. It seems that Gazebo 9.0.0 which is packaged with the osrf/ros:melodic-desktop-full docker image has some bugs. If you use this image, update Gazebo. (This and other performance issues were fixed as of Gazebo 9.16)

Asked by jdekarske on 2021-01-26 21:44:31 UTC

Comments

A similar issue exists when following the Nav2 Getting Started Guide in the ROS 2 Humble container. The slow first launch of Gazebo causes the example to fail.

This initial delay when launching Gazebo is a result of downloading models from the internet. To avoid repeated downloads with each new container, consider mounting the ~/.gazebo/models directory externally.

Note: this issue can be reproduced by launching osrf/ros:humble-desktop-full, installing ros-humble-gazebo-ros-pkgs with apt, and then run ros2 launch gazebo_ros gazebo.launch.py.

Asked by j3soon on 2023-08-09 20:32:17 UTC

Comments