Skip to content

Commit

Permalink
Fixing missing libcar.dylib and libdriver.dylib on MacOS (#6482)
Browse files Browse the repository at this point in the history
* Fixing missing libcar.dylib and libdriver.dylib on MacOS when using extern controller.

These dylibs are located at `Contents/lib/controller`. However, the code is looking for them in `Contents/MacOS/lib/controller`. Removing the extra `.../MacOS/...` from the path fixes the issue.

* Update changelog-r2023.md

* Update changelog-r2023.md

---------

Co-authored-by: Olivier Michel <[email protected]>
  • Loading branch information
SarvagyaVaish and omichel authored Jan 18, 2024
1 parent 3439251 commit 3c3f849
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/reference/changelog-r2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Released on XXX XXth, 2023.
- Enabled the launching of MATLAB desktop from the extern launcher ([#6366](https://github.com/cyberbotics/webots/pull/6366)).
- Improved overlays visible in Overlays menu by adding all the robots in the menu list ([#6297](https://github.com/cyberbotics/webots/pull/6297)).
- Bug fixes
- Fixed Python path for `libcar.dylib` and `libdriver.dylib` on macOS ([#6482](https://github.com/cyberbotics/webots/pull/6482)).
- Avoided crash and provided better warnings when attempting to access PROTO nodes in a wrong way from the supervisor API ([#6473](https://github.com/cyberbotics/webots/pull/6473)).
- Fixed errors loading template PROTO if the system user name, the project path, or the temporary directory path contains the `\` character ([#6288](https://github.com/cyberbotics/webots/pull/6288)).
- Fixed Webots and libController version comparison not to take revisions into account ([#6315](https://github.com/cyberbotics/webots/pull/6315)).
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/python/vehicle/car.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self):
elif sys.platform == 'win32':
path = os.path.join('lib', 'controller', 'car.dll')
elif sys.platform == 'darwin':
path = os.path.join('Contents', 'MacOS', 'lib', 'controller', 'libcar.dylib')
path = os.path.join('Contents', 'lib', 'controller', 'libcar.dylib')
self.api = ctypes.cdll.LoadLibrary(os.path.join(os.environ['WEBOTS_HOME'], path))
self.api.wbu_car_get_front_wheel_radius.restype = ctypes.c_double
self.api.wbu_car_get_indicator_period.restype = ctypes.c_double
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/python/vehicle/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def loadApi() -> ctypes.cdll:
car = 'car.dll'
driver = 'driver.dll'
elif sys.platform == 'darwin':
path = os.path.join('Contents', 'MacOS', 'lib', 'controller')
path = os.path.join('Contents', 'lib', 'controller')
car = 'libcar.dylib'
driver = 'libdriver.dylib'
ctypes.cdll.LoadLibrary(os.path.join(os.environ['WEBOTS_HOME'], path, car))
Expand Down

0 comments on commit 3c3f849

Please sign in to comment.