Ask Your Question

Revision history [back]

Did you put the __init__.py in the msg sub dir? If so: remove it, remove your build and devel folder, rebuild your workspace and see whether things start working.

Did you put the __init__.py in the msg sub dir? If so: remove it, remove your build and devel folder, rebuild your workspace and see whether things start working.


Edit:

That might have been the solution, __init__.py was empty. But I make a completely new ros module and just copied the msg files and scripts to it, now it works. I have know idea why exactly, but ok

You should not place any __init__.py files anywhere except when you're creating Python modules. ROS msgs (so the .msg files) are not modules. The code generated from them becomes a module, but that is all done automatically for you.

The __init__.py in your package root and the msg subdir should not be there. Only if you're creating a Python module, you place one in the subdir that stores the sources for your module.