ROS2 Package relative import path fails
Hello All,
I'm trying to run ROS2 node using PyCharm and I meet the import problem.
My package's structure is:
main.py
sub_folder
------> init.py
------>sub_func1.py
------>sub_sub_folder
------------->init.py
------------->sub_func2.py
And then I get the import problem...
If I use from sub_folder/sub_func1 import * everything works. But then it fails when I build the ROS2 package.
Then I change the import to from .sub_folder/sub_func1 import * (with dot before the folder) as was explained in https://answers.ros.org/question/367793/including-a-python-module-in-a-ros2-package/ the build works well, but "play" in PyCharm fails...
How can I make the both work?
Please sign in to leave a comment.