Unit2 - small issue in setup.py

Hi,

        (os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')),
        (os.path.join('share', package_name, 'config'), glob('config/*')),

The above is the recommended part of the setup.py, but for this, launching does nto work with the command

ros2 launch cartographer_slam cartographer.launch.py

So maybe this recommendation would be better:

        (os.path.join('share', package_name), glob('launch/*.launch.py')),
        (os.path.join('share', package_name, 'config'), glob('config/*'))

Thank you in advance
Péter

Hi Peter,
there is something wrong in your system if you need to apply your modification to the setup.py file and not use the provided line.

The correct addition to the setup.py is the following:

(os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')),
(os.path.join('share', package_name, 'config'), glob('config/*')),

That line, indicates where in the install folder the launch file will be installed. It should be installed in the /home/user/ros2_ws/install/cartographer_slam/share/cartographer_slam/launch directory, as shown in the following image:

image

If you don’t install it in that directory, then the launch system will not be able to find it.

Please do the following:

  1. Delete your install and build directories
  2. Change your setup.py to the one I mentioned above
  3. Recompile

Now it should work.

Hi
Thanks, you are absolutely right. There is nothing wrong with the recommended setup.py.

Péter

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.