Running all the nodelet code in the same thread

asked 2021-02-24 04:04:32 -0600

madamczyk gravatar image

Hello, I've got a problem with some nodelet specific issue. I've got a library that needs to be run in only one thread (license make me do this). So, I have to initialize this library in the nodelet constructor or onInit method but even if I use single-thread API for nodelets the thread from the constructor/onInit is not the same as that in the callback where I use this library. I tried to run nodelet in the standalone mode but the behavior was the same - another thread for onInit and another for callbacks.

Is there any way to use nodelets that will do onInit and callbacks in the same thread to prevent license errors? Or... do I have to use a simple node instead.

Yes, I know I can run some internal thread in the nodelet to do there all the processing connected with this 3rd part library, but I want to do it as simple as possible.

Any suggestions are greatly appreciated.

edit retag flag offensive close merge delete