ROS2 python how to include non ros python modules

asked 2020-02-15 13:08:45 -0500

S.D. gravatar image

I'm usually developing in ROS1 Cpp and got a maybe simple question related to ros2 in python: I' m trying to create a package that uses some non ros python files in a subdirectory e.g. lib/ and which also depends on some big libraries e.g. pytorch.

Is it possible to install the external dependencies in a virtualenv and let ros use this python interpreter? How can I import modules from a subdirectory using colcon?

Thx in advance for any help!

edit retag flag offensive close merge delete


colcon isn't doing anything for out-of-workspace dependencies. You can use rosdep to install declared dependencies or set them up yourself however you want (e.g. using a venv). colcon will simply build/install the package.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-02-18 17:07:37 -0500 )edit