Nodelet - Two threads?
I have a nodelet that I am running through the multithreaded nodelet manager. In my nodelet I launched two threads. One to publish, and I have another one subscribing.
The thread that publishes works, but the one that subscribes, throws this error:
[ERROR] [1589842000.764874218]: SingleThreadedSpinner: Attempt to spin a callback queue from two spinners, one of them being single-threaded.
In the future this will throw an exception! You might want to use a MultiThreadedSpinner instead.
I tried using MultiThreadedSpinner and I get
Attempt to spin a callback queue from two spinners, one of them being single-threaded
Also:
recvfrom: Resource temporarily unavailable
Observation:
MultiThreadedSpinner
does not deal with threads you create. It will internally use multiple threads to service the callback queues associated withPublisher
s andSubscriber
s, but all of that is invisible to user-level code.Also: you typically don't create spinners yourself in nodelets. That's all taken care of for you by the manager (which you already refer to).
It would be good to show code as we can then see whether you are doing something unsupported.