Custom message with rosbuild & rospy [No module named *]
Hello!
I'am trying to build a ros node which use a custom message. I have installed ROS Indigo on Ubuntu 12.04. The workspace I use is rosbuild and the code is in Python.
The problem I am facing with is that I'm unable to import the custom message I just created. The import statement for my message is the following:
from roi_py.msg import *
or
from roi_py.msg import sendMsg
Where "sendMsg" is the name of my message located in msg/sendMsg.msg
But the result is the following:
user@system:~/ROS_Workspace/sandbox/roi_py$ rosrun roi_py roi.py
Traceback (most recent call last):
File "/home/user/ROS_Workspace/sandbox/roi_py/scripts/roi.py", line 10, in <module>
from roi_py.msg import *
ImportError: No module named roi_py.msg
In the same project I also have some CPP files. In those file I can use my messages and works. It looks like only Python is not recognizing my custom messages.
Also the package path seems to be good:
user@system:~/ROS_Workspace/sandbox/roi_py$ echo $ROS_PACKAGE_PATH
/home/user/ROS_Workspace/sandbox:/opt/ros/indigo/share:/opt/ros/indigo/stacks
PS: However, the statement to include standard messages is working:
from std_msgs.msg import String
Do you guys have any idea?
PS: rosbuild_genmsg() is also uncommented on CMakeLists.txt
And the tree of roi_py looks like:
├── bin
├── CMakeLists.txt
├── lib
├── mainpage.dox
├── Makefile
├── manifest.xml
├── msg
│ ├── recvMsg.msg
│ └── sendMsg.msg
├── README.md
├── scripts
│ └── roi.py
└── src
└── roi_py
└── __init__.py
If you are using ROS Indigo, you should definitely be using
catkin
instead ofrosbuild
.rosbuild
was deprecated several releases ago, and you are less likely to run into problems and more likely to get help if you switch to the more modern build system.I will try to go with catkin then. Thank you, didn't know that rosbuild is outdated.
@jarvisschultz: Can't believe. The same error on catkin workspace after followed all instructions step by step from tutorials...
I think you may be having the same problem as in this question: http://answers.ros.org/question/11367...