robotology / icub-models

Official URDF and SDF models of the iCub humanoid robot.
Creative Commons Attribution Share Alike 4.0 International
33 stars 33 forks source link

Fix the python package when installed from cmake #150

Closed GiulioRomualdi closed 2 years ago

GiulioRomualdi commented 2 years ago

Unfortunately #149 was not enough. Thanks to @Nicogene I noticed that path returned by get_models_path() was still not existing 😭

First of all, there was a bug in the construction of the PYTHON_ABSOLUTE_INSTDIR in the CMakeLists.txt file (fixed in https://github.com/robotology/icub-models/commit/664e5af75d8ea3488615431131e1c2b40e5ab88a)

Then I noticed that pathlib.Path(__file__) points to the file location and not to the folder containing the file. This fixes the problem 9366eb85318eb83576a8d5c2d72a0b155ee3da7d

@Nicogene could you please check if this solves your issue?