I encountered a snippet of code like:
from object_recognition_msgs.msg import *
In my opinion, this but I found there’s no msg.py in object_recognition_msgs(which is a directory),
however, there’s a directory named “msg” in object_recognition_msgs, the structure of the directory is
object_recognition_msgs
├── msg
├── __init__.py
├── _ObjectId.py
├── _ObjectInformation.py
├── _ObjectRecognitionActionFeedback.py
├── _ObjectRecognitionActionGoal.py
├── _ObjectRecognitionAction.py
├── _ObjectRecognitionActionResult.py
├── _ObjectRecognitionFeedback.py
├── _ObjectRecognitionGoal.py
├── _ObjectRecognitionResult.py
├── _RecognizedObjectArray.py
├── _RecognizedObject.py
├── _TableArray.py
└── _Table.py
I interpreted “from object_recognition_msgs.msg import *” as importing all python files in object_recognition_msgs/msg, is this interpretation correct?
Thanks in advance.
That statement would import all names from the
__init__.pymodule in the package, not the files contained.You’d have to import each module in the package in the
__init__.pyfile explicitly for the*to import everything in all the modules in the package.