ROS2 cannot find Webots in WSL2

asked 2022-05-19 09:45:28 -0500

AlexandrosNic gravatar image

In WSL2, the recommended way to install Webots, is to install it natively in Windows (instead in WSL2), because that way you can take advantage of the GPU, but not if you run it through WSL2. Then the way to open Webots through WSL2 was to create a symlink that prompts to the executable 'C/Program Files/Webots/msys64/mingw64/bin/webotsw.exe', and include the path to the symlink in my PATH variable.

That way, when I run 'webots', Webots open with the support of GPU.

However, when I run a launch file that prompts to open Webots, it cannot recognize the Windows installed Webots, and search for Webots in the WSL2 system and cannot find it. What is the way to prompt ROS2 to search Webots in the directories that I declared in the environment variables? (C/Program Files/Webots)

edit retag flag offensive close merge delete


Can't you change the launch file to open explicitly Webots from the /C/Program Files/Webots folder?

The path to the webots binary file is:

C:\Program Files\Webots\msys64\mingw64\bin\webots.exe

Olivier Michel gravatar image Olivier Michel  ( 2022-06-17 04:40:34 -0500 )edit

Maybe is me not having sufficient knowledge of how ROS2 handles launch files to open a program, but even when I explicitly declared the path to Webots, it still didn't work

AlexandrosNic gravatar image AlexandrosNic  ( 2022-06-29 10:00:32 -0500 )edit

Alternatively, can you start a script that will in turn start Webots from the symlink to 'C/Program Files/Webots/msys64/mingw64/bin/webotsw.exe'?

Olivier Michel gravatar image Olivier Michel  ( 2022-06-29 10:05:26 -0500 )edit

I would like to contribute Oliver, but I chose to move to native Ubuntu (dual boot), since I experienced more problems with WSL2 (ROS related), and time is pressing me. I would rather go back to WSL2 when it will be more stable with ROS2. So in that case I will reply to your proposed solution later on when I will try again

AlexandrosNic gravatar image AlexandrosNic  ( 2022-06-29 10:16:33 -0500 )edit