How does catkin_install_python works in CMakelists.txt?
I have recently learnt about the catkininstallpython in CMakelists.txt, where you can specify your python programs and ROS will take care to make them executable and append the appropriate shebang to the script.
I just wonder how it works. I have experimented with creating a simple Python program that simply prints “hello world” (not executable, no shebang). Then I added that script in CMakelists.txt under catkininstallpython. Then I ran catkinmake. Now the script can be run using rosrun mypkg myscript.py. If I now change the content of the script I don't have to run catkinmake again, it just works! So, how does ROS work under the hood when it comes to this? Initially, I thought it creates some soft link to the file, but how does it append the shebang then?
Thank you!
Asked by pyros on 2022-04-03 11:03:48 UTC
Comments