Ask Your Question

Revision history [back]

I notice you're publishing the image in your __init__ method right after the publisher is created. This is probably the cause of this issue.

Publishers take a while to setup and for subscribers to attach to them, so in this case the image is probably being published before any subscribers are registered, which is why you're not seeing anything on the topic.

Try changing your code so it uses a loop with a 1 second rate or a timer callback to publish the same image once per second. This should give time for subscribers to attach and the image to be viewed.

Hope this helps.