Problems with gazebo simulation in GitLab CI (Continuous Integration) testing
Dear all,
In the past, I was able to use Kinetic with gazebo 7 (headless) to have it as a part of CI (Continuous Integration) testing in GitLab without any issues. Since Melodic and gazebo 9 I faced a serious problem.
Let me explain... As a base of my CI script, I use osrf/ros:melodic-desktop-full
So, my .gitlab-ci.yml file looks like:
stages:
- build
- test
image: osrf/ros:melodic-desktop-full
before_script:
- apt-get update && apt-get upgrade -y
- apt-get install -y python-rosinstall python-rosinstall-generator python-wstool build-essential
- apt-get install -y alsa-utils
- apt-get clean
- mkdir -p ~/catkin_ws/src
build:
stage: build
script:
- cd ~/catkin_ws/src
- git clone https://gitlab.com/...r.git
- cd ~/catkin_ws
- wstool init src src/cs_monster/coscr.rosinstall
- rosdep install --from-paths src --ignore-src -r -y
- catkin_make -DCMAKE_BUILD_TYPE=Release
testing:
stage: test
script:
- cd ~/catkin_ws/src
- git clone https://gitlab.com/...r.git
- cd ~/catkin_ws
- wstool init src src/cs_monster/coscr.rosinstall
- rosdep install --from-paths src --ignore-src -r -y
- catkin_make -DCMAKE_BUILD_TYPE=Release
- source devel/setup.bash
- export GAZEBO_IP=127.0.0.1
- roslaunch coscr_gazebo playpen.launch test:=true &
- sleep 90
- roslaunch coscr_navigation amcl_demo.launch test:=true &
- sleep 190
- rosnode kill -a
So when the first roslaunch executes, I get the following error:
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
2742 ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
2743 ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
2744 ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
2745 ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
2746 ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
2747 ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
2748 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
2749 AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
I have seen people facing similar problems when they try to run gazebo through WSL but I was not able to find a solution. Do you have any idea?
Asked by Angelos on 2019-12-02 11:26:27 UTC
Comments
I’m trying to do this same thing. I believe the issue is that the GitLab CI runner has no sound card yet Gazebo still expects one. Dummy sound cards can be installed but require installing a kernel module which is probably outside the scope of what you can do in a container.
See also: https://www.alsa-project.org/wiki/Matrix:Module-dummy
Asked by ChrisThrasher on 2021-01-24 17:15:48 UTC