rodrigoqueiroz / geoscenarioserver

8 stars 1 forks source link

Fix installation of Lanelet2 library for Python3.8 #36

Closed mantkiew closed 3 years ago

mantkiew commented 3 years ago

Problem 1

After building Lenelet2 catkin workspace, the generated install/opt/ros/lanelet2/_setup_util.py contained the following incorrect shebang line:

#!/home/ma/anm_unreal_sim/submodules/geoscenarioserver/.venv/bin/python3.8

Which prevents sourcing of the catkin workspace on the target user machines. The correct line should be

#!/usr/bin/python3.8

Problem 2

The generated code in install/opt/ros/lanelet2/ contains build machine paths, for example,

/home/ma/anm_unreal_sim/submodules/geoscenarioserver/catkin_ws/install/opt/ros/lanelet2/

This is an open problem reported here: https://github.com/catkin/catkin_tools/issues/387 and it does not seem there will be a solution anytime soon.

The prefix /home/<username>/anm_unreal_sim/submodules/geoscenarioserver/catkin_ws/install/ and also /home/<username>/anm_unreal_sim/submodules/geoscenarioserver/catkin_ws/devel/ should be removed.

Changes

Testing problem 1

  1. clean up
    $ cd anm_unreal_sim/submodules/geoscenarioserver
    $ git clean -fdx
  2. run the installation script
    $ bash scripts/install_dependencies.bash

    The script should complete without any errors.

  3. Check that the first line of the file install/opt/ros/lanelet2/_setup_util.py is
    #!/usr/bin/python3.8
  4. Source the worskspace and check that the library can be imported:
    $ source catkin_ws/install/opt/ros/lanelet2/setup.bash
    $ python3.8
    >>> import lanelet2
    >>> 

    Testing problem 2

    Search for /home/<username>/anm_unreal_sim/submodules/geoscenarioserver/catkin_ws/install/ and /home/<username>/anm_unreal_sim/submodules/geoscenarioserver/catkin_ws/devel/ inside all subfolders of catkin_ws/install and the strings should not be present.

mantkiew commented 3 years ago

In catkin_ws/devel I ran

@WAEliasmith we are not concerned with the devel space as it is only for developers. We are only cleaning up the install space, which contains the binaries we distribute to the users. So, there's nothing wrong with these paths appearing in the devel space.