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

Installing Python module in ROS2 package

asked 2022-05-27 21:45:18 -0600

sea-bass gravatar image

updated 2022-05-27 21:47:08 -0600

Hello all!

I have a GitHub repo in which I want to distribute a pure Python module and a ROS2 wrapper around that. So think:

my_package/
    - submoduleA/
    - submoduleB/
    - setup.py
    - COLCON_IGNORE
my_package_ros/
    - scripts/
    - CMakeLists.txt
    - package.xml

At the moment, I have a bash script that creates a Python virtualenv that installs my_package and some other dependencies, but I would like to automate this for ROS workflows.

Specifically, is there a way I can ensure that when running colcon build, I can install the my_package module when installing my_package_ros?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-29 01:31:25 -0600

aprotyas gravatar image

Yes, I believe you're looking for the following functions from the ament_cmake API:

Having said that, I don't think said functions actually introspect/respect things in your setup.py file. For reference: https://discourse.ros.org/t/mixed-pyt...

edit flag offensive delete link more

Comments

Thank you!

As you said, ament_python_install_package gets me the actual package installed, but it doesn't honor the install_requires listed in setup.py or setup.cfg (I tried both)... so that's a bummer.

I unfortunately still need a manual way to actually install those dependencies via pip outside of the main call to colcon build.

sea-bass gravatar image sea-bass  ( 2022-05-29 07:56:37 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2022-05-27 21:45:18 -0600

Seen: 362 times

Last updated: May 29 '22