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

Revision history [back]

click to hide/show revision 1
initial version

You need to specify where your python module is in the setup.py. Using the moveit_commander example: https://github.com/ros-planning/moveit/blob/kinetic-devel/moveit_commander/setup.py#L5-L6

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

d = generate_distutils_setup()
d['packages'] = ['moveit_commander']
d['package_dir'] = {'': 'src'}

setup(**d)

Because of this, the src directory is the where catkin will expect to find the python module.

Shameless plug, I can offer up a repo I maintain answer to your larger question about package structure a few folder layers deep, intera_interface: https://github.com/RethinkRobotics/intera_sdk/tree/master/intera_interface

Generally speaking, the folder structure for a package containing both python modules and python scripts is as follows:

 catkin_ws
|_  src
     |_ python_package
                 |_ scripts
                 |    |_python_executable_script_1
                 |    |_python_executable_script_2
                 |_src
                 |   |_python_public_module
                 |   |_python_private_module_1
                 |   |_python_private_module_2
                 |_ CMakeLists.txt   # <-- invoke catkin_python_setup() in here
                 |_ package.xml
                 |_setup.py          # <--specify public module & directory in here