ROS Melodic no longer finding python scripts
NOTE: Working in Windows (I have to because this is the machine that my work requires me to use).
I’m creating a project which will communicate with another companies ROS project. Originally, I was building it in Noetic (which was also on this same windows machine) but I was told they are using Melodic so I have to revert back to Melodic on mine. When I was running my packages in Noetic it ran fine … I used the following command:
rosrun gui_pkg main.py
However, when I changed over to Melodic for some reason it no longer can find the main.py so in order to run it, I need to run the following command:
rosrun gui_pkg scripts/main.py
That’s not a big deal but I am now running into errors finding other custom libraries. For example, the following import no longer works:
from gui_templates.tx_rx_display import TxRxDisplay
Any ideas of why this is now an issue? Btw, I also have the very simple talker.py/listener.py package from the ROS website that worked completely fine in Noetic but requires the "scripts/talker.py" in the rosrun command in order to run as well.
Some relevant info:
OS: Windows 10
folder layout under gui_pkg folder
- setup.py
- CMakeLists.txt
- package.xml
- scripts
- main.py
- gui_templates
- tx_rx_display.py
CONTENTS of setup.py:
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=[‘gui_templates’],
package_dir={‘’: ‘scripts’}
)
setup(**d)