include srv files in python catkin project
I am currently having some issues with importing my service files into my project. i can't import into my service_def.py file.. Why is that not possible?
I made it as a rosnode, my src folder of the catkin_workspace looks like this
.
├── CMakeLists.txt -> /opt/ros/indigo/share/catkin/cmake/toplevel.cmake
└── service
├── CMakeLists.txt
├── include
│ └── service
│ ├── __init__.py
│ ├── service_def.py
│ └── service_def.pyc
├── package.xml
├── setup.py
├── src
│ └── service_node.py
└── srv
├── get.srv
├── set.srv
└── __init__.py
service_def.py is defined as such
from ..srv import *
And my service_node.py which i rosrun
imports service_def.py
import service.service_def
So why cant I import my service messages in service_def.py?
error message:
k@k:~/python_service/src$ rosrun service service_node.py
Traceback (most recent call last):
File "/home/k/python_service/src/service/src/service_node.py", line 5, in <module>
import service.service_def
File "/home/k/python_service/src/service/include/service/service_def.py", line 1, in <module>
from ..srv import *
ValueError: Attempted relative import beyond toplevel package