install python node with colcon
Hi everybody,
I'm developing a simple python node for autoware.ai, so during development I had my catkin workspace folder and to install everything I just used catkin_make command.
Here the folder structure of the node:
node_name/
├── CMakeLists.txt
├── README.md
├── launch
│ └── node_launchfile.launch
├── nodes
│ └── node_name_node.py
├── package.xml
├── setup.py
└── src
└── node_name
├── __init__.py
├── package_1
├── package_2
├── package_3
└── package_n
The content of setup.py is:
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(packages=['node_name'],
package_dir={'': 'src'})
CMakeLists.txt contains the python stuff:
find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
autoware_msgs
)
catkin_python_setup()
...
catkin_install_python(PROGRAMS
nodes/node_name_node.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
Now I'm trying to use colcon to build/install the node using:
colcon build --cmake-clean-cache --packages-up-to node_name
But when I run the node then I get:
[ERROR] [1596211499.485229]: Error loading the module package_1:
No module named node_name.package_1
So it seems like that the packages are not installed. Anyone can give me some help?