Is the following the ROS2 python package convention?
Put modules that you want to import in a folder with the same name as the package, and put ros nodes/py scripts in a script folder? In this case, what changes do I need to make to the following setup.py file to create an executable out of the my_script.py file that is in the scripts folder?
Hi @roalgoal , for clarification, I would like to create an executable out of a script that resides in the scripts folder. However, if I leave setup.py the way it is in my first post then, colcon compiles the package without any complaints. However, when I ros2 run the executable then, it says it can’t find the module named my_package.my_script. What am I doing wrong? Also, FYI, I’m using the ament_python system and not ament_cmake_python.
I was able to resolve this issue today. So this is useful for future readers, the solution is to specify the scripts folder as a python package and also state the entry point referencing the scripts folder as follows: packages=[package_name, 'scripts'],