Import file of functions

asked 2021-01-03 06:24:15 -0500

ralf gravatar image

Hi,

I am working with ROS2 Dashing in Python. I have a node that takes a picture, does a lot of processing and then publishes a message, but it is an awful lot of code to include in one file. I'd like to put some of the functions for the code in separate files for clarity, but if I just "import file" at the top of the node, it doesn't work as when the package is built, those files aren't copied over. Is there a way to make ROS copy them when I build my package, or a better way of doing this? Sorry if this is a silly question!

Thanks

edit retag flag offensive close merge delete