Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gazebo fails to load in a WSL environment #1

Closed
tpoignonec opened this issue Jun 15, 2023 · 0 comments
Closed

Gazebo fails to load in a WSL environment #1

tpoignonec opened this issue Jun 15, 2023 · 0 comments
Assignees

Comments

@tpoignonec
Copy link
Owner

(NB. solved at time of writing, just for achiving puroposes)

Issue:

Gazebo looks for a sound card driver, which is not (at least on my machine) configured.

ros2 launch iiwa_bringup iiwa.launch.py use_sim:=true
   ...
[spawn_entity.py-3]   warnings.warn(
[spawn_entity.py-3] [INFO] [1686844024.666744458] [spawn_entity]: Waiting for entity xml on /robot_description
[spawn_entity.py-3] [INFO] [1686844024.678572497] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-3] [INFO] [1686844024.678748899] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-3] [ERROR] [1686844055.327565612] [spawn_entity]: Service %s/spawn_entity unavailable. Was Gazebo started with GazeboRosFactory?
[spawn_entity.py-3] [ERROR] [1686844055.327841288] [spawn_entity]: Spawn service failed. Exiting.
[ERROR] [spawn_entity.py-3]: process has died [pid 16870, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -topic /robot_description -entity /iiwa14 --ros-args'].
[INFO] [spawner-5]: process started with pid [17015]
[spawner-5] [INFO] [1686844057.669768321] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[gzserver-1] ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
[gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
[gzserver-1] ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
[gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
[gzserver-1] ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
[gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
[gzserver-1] ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
[gzserver-1] ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
[gzserver-1] AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
[spawner-5] [INFO] [1686844059.705863684] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1686844061.719889214] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1686844063.733643022] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-5] [ERROR] [1686844065.744663933] [spawner_joint_state_broadcaster]: Controller manager not available
   ...

Ideal solution:

Configure Gazebo so it doesn't look for this sound card.

Current workaround:

Configure a sound card with pulseaudio.
See microsoft/wslg#634, microsoft/wslg#864, microsoft/WSL#5816 for discussions on this issue or similar ones.

Since I tried a few things, the following procedure could probably be simplified (i.e., remove unnecessary steps...).
But this worked :

sudo apt install libpulse-dev pulseaudio  pulseaudio-utils apulse 
sudo apt install libasound2-plugins 

Create a ~/.asoundrc file :

pcm.default pulse
ctl.default pulse

and

systemctl --user restart pulseaudio

Then reboot WSL (wsl --shutdown).

@tpoignonec tpoignonec self-assigned this Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant