ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

python workspace structuring

asked 2016-11-21 13:10:00 -0600

215 gravatar image

updated 2016-11-21 16:31:03 -0600

I am currently struggling to setup a python ros workspace.. I've been following this guide

http://duckietown.mit.edu/media/pdfs/...

and my src folder looks like this

src
├── CMakeLists.txt -> /opt/ros/indigo/share/catkin/cmake/toplevel.cmake
└── service
    ├── CMakeLists.txt
    ├── include
    │   └── service
    │       ├── __init.py__
    │       └── util.py
    ├── package.xml
    ├── setup.py
    └── src
        └── publisher.py

When i run rosrun service publisher.py i get the error message:

line 5, in <module>
    from service import util 
ImportError: cannot import name util

setup.py

## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['service'],
package_dir={'': 'include'},
)
setup(**setup_args)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-11-21 16:32:20 -0600

215 gravatar image

Yeah.. I am blind.

__init.py__ != __init__.py
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-11-21 13:10:00 -0600

Seen: 178 times

Last updated: Nov 21 '16