ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

asked 2020-11-15 20:40:43 -0500

jdekarske gravatar image

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 :)

edit retag flag offensive close merge delete

Comments

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

jdekarske gravatar image jdekarske  ( 2020-11-15 20:41:04 -0500 )edit

bump, please help

jdekarske gravatar image jdekarske  ( 2020-12-08 00:14:03 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-01-26 20:44:31 -0500

jdekarske gravatar image

updated 2021-01-26 20:46:02 -0500

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)

edit flag offensive delete link more
0

answered 2023-08-09 20:32:17 -0500

j3soon gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-11-15 20:07:42 -0500

Seen: 1,089 times

Last updated: Aug 09 '23