until end of section 2.6 I think I followed all steps. Still when launching the first launch file after
ros2 launch my_package my_package_launch_file.launch.py
file 'my_package_launch_file.launch.py' was not found in the share directory of package 'my_package' which is at '/home/user/ros2_ws/src/install/my_package/share/my_package'
but it exists in
any hint why the build didn’t add the launch File to the package ?
Hi @vkuehn ,
I believe, it is because you might have missed some line(s) in your
Check if you have done the following steps: (specifically step 2 in the below snippet)
Make changes to setup.py file:
Add: import os
Add: from glob import glob
Add to data_files list: (os.path.join('share', package_name), glob('launch/*.launch.py'))
Add to entry_points dict console_scripts:
['python_executable_name = pkg_name.python_executable_name:main']
And make sure your
launch.py file is in this format:
Generate Launch File:
from launch import LaunchDescription
from launch_ros.actions import Node
I believe, these should fix your problem!
Let me know if you find what I said to be helpful !
That did make it work, Thanks a lot !
The Import for the setup was missing.