Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 4

How to install my Python modules as part of my ROS package

Previous: Answer by billmania for I'm using:ROS Melodicubuntu 18.04Python 3.6.9My ROS project name is "ros_moos" and my Python package name is "ros_moos".My directory structure under ~/catkin_ws/src/ros_moos is:├── CMakeLists.txt ├── launch │   └── ros_moos.launch ├── LICENSE ├── msg │   ├── AuvMove.msg │   ├── AuvPose.msg │   ├── AuvSafety.msg │   └── AuvSystems.msg ├── nodes │   ├── ros_moos │   │   ├── auv_control.py │   │   ├── auv_status.py │   │   ├── __init__.py │   │   ├── moos_ros.py │   │   ├── moos_test.py │   │   └── uuv_moos.py │   └── tests ├── package.xml ├── params │   └── auv_params.yaml ├── README.md ├── requirements.txt └── setup.py setup.py contains:from setuptools import setup from catkin_pkg.python_setup import generate_distutils_setup setup_args = generate_distutils_setup( version="0.0.1", packages=['ros_moos'], package_dir={'': 'src'}) setup(**setup_args) In the CMakeLists.txt I have catkin_python_setup() enabled. I build the project with "catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3" and there are no errors.roslaunch can find my ROS package and start my two Python nodes, auv_control.py and auv_status.py. rostopic and rosmsg can find the definitions for AuvPose and the other messages.The problem is the other Python modules, moos_ros.py and uuv_moos.py are NOT installed into the /devel/ environment and auv_status.py can't import those modules when started by roslaunch.According to https://docs.ros.org/api/catkin/html/... and https://docs.ros.org/api/catkin/html/... I've done what's required.Is this a known issue or need I do something more?
$
0
0
I'm using: **ROS Melodic** **ubuntu 18.04** **Python 3.6.9** My ROS project name is "ros_moos" and my Python package name is "ros_moos". My directory structure under **~/catkin_ws/src/ros_moos** is: ├── CMakeLists.txt ├── launch │   └── ros_moos.launch ├── LICENSE ├── msg │   ├── AuvMove.msg │   ├── AuvPose.msg │   ├── AuvSafety.msg │   └── AuvSystems.msg ├── nodes │   ├── ros_moos │   │   ├── auv_control.py │   │   ├── auv_status.py │   │   ├── __init__.py │   │   ├── moos_ros.py │   │   ├── moos_test.py │   │   └── uuv_moos.py │   └── tests ├── package.xml ├── params │   └── auv_params.yaml ├── README.md ├── requirements.txt └── setup.py **setup.py** contains: from setuptools import setup from catkin_pkg.python_setup import generate_distutils_setup setup_args = generate_distutils_setup( version="0.0.1", packages=['ros_moos'], package_dir={'': 'src'}) setup(**setup_args) In the CMakeLists.txt I have catkin_python_setup() enabled. I build the project with "catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3" and there are no errors. roslaunch can find my ROS package and start my two Python nodes, auv_control.py and auv_status.py. rostopic and rosmsg can find the definitions for AuvPose and the other messages. The problem is the other Python modules, moos_ros.py and uuv_moos.py are NOT installed into the /devel/ environment and auv_status.py can't import those modules when started by roslaunch. According to https://docs.ros.org/api/catkin/html/howto/format2/installing_python.html#modules and https://docs.ros.org/api/catkin/html/user_guide/setup_dot_py.html I've done what's required. Is this a known issue or need I do something more?

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>