Skip to content

Commit

Permalink
WSL error: local PROTOs cannot be loaded (#573)
Browse files Browse the repository at this point in the history
* Update path to wsl format

* Update changelogs
  • Loading branch information
ygoumaz authored Dec 23, 2022
1 parent 241be2f commit d384fe0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions webots_ros2/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog for package webots_ros2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023.0.1 (2023-XX-XX)
------------------
* Fix relative assets in WSL.

2023.0.0 (2022-11-30)
------------------
* Add support for the new Python API of Webots R2023a
Expand Down
4 changes: 4 additions & 0 deletions webots_ros2_driver/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog for package webots_ros2_driver
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2023.0.1 (2023-XX-XX)
------------------
* Fix relative assets in WSL.

2023.0.0 (2022-11-30)
------------------
* Add support for the new Python API of Webots R2023a
Expand Down
5 changes: 4 additions & 1 deletion webots_ros2_driver/webots_ros2_driver/webots_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ def execute(self, context: LaunchContext):
if os.path.isabs(url_path) or url_path.startswith('webots://') or url_path.startswith('http://') or url_path.startswith('https://'):
continue

new_url_path = '"' + os.path.split(world_path)[0] + '/' + url_path + '"'
new_url_path = os.path.split(world_path)[0] + '/' + url_path
if self.__is_wsl:
new_url_path = subprocess.check_output(['wslpath', '-w', new_url_path]).strip().decode('utf-8').replace('\\', '/')
new_url_path = '"' + new_url_path + '"'
url_path = '"' + url_path + '"'
content = content.replace(url_path, new_url_path)

Expand Down

0 comments on commit d384fe0

Please sign in to comment.