ImportError: cannot import name (trying to import .msg file from a folder in the same workspace as a python file that imports it)
I am currently running ROS Melodic on a WSL/Ubuntu 18.04. I am trying to import a couple .msg files for a python project. Whenever I try to run my code, I always get the same error:
Traceback (most recent call last):
File "/root/catkin_ws/src/beginner_tutorials/src/object_detector.py", line 6, in <module>
from beginner_tutorials.msg import DetectedObjectInfo, TrackedObjectInfo
ImportError: cannot import name 'DetectedObjectInfo'
Because this website is not letting me attach photos, all I can do is show the line of where my error occurs:
from beginner_tutorials.msg import DetectedObjectInfo, TrackedObjectInfo
Inside my beginner_tutorials folder, I have a folder called "msg", with .msg files "DetectedObjectInfo.msg" and "TrackedObjectInfo.msg". There is also a folder called "src" inside the beginner_tutorials folder that contains the python file that I am using which contains the import statement with an error.
I'm pretty sure I added everything in my CMakeLists.txt file and package.xml file accordingly. Could anyone help me with this issue regarding the ImportErrors?