Robotics StackExchange | Archived questions

waitForMessage and wait untill the call back function is done

Say we already have a subscriber for a topic which has its own callback function.

My main goal is to keep a line of code somewhere else waiting until the this subscriber has received a massage on its topic and is also done with its callback function.

the waitForMessage allows me to keep everything waiting until the subscriber has received a message, but it does not wait until the it is also done with its call back function, right?

is there a way to wait until the callback function is also done?

Asked by azerila on 2020-04-25 09:11:15 UTC

Comments

This question confuses me. There is no "subscriber callback" when you use waitForMessage(..). That function simply blocks until it has received a single message of the type you indicate on the topic you specify.

Which subscriber are you referring to here?

Asked by gvdhoorn on 2020-04-25 09:37:50 UTC

@gvdhoorn sorry I should have explained it better. Say we already have a subscriber for a topic which has its own callback function. My main goal is to keep a line of code somewhere else waiting until the this subscriber has received a massage on its topic and is also done with its callback function. the waitForMessage allows me to keep everything waiting until the subscriber has received a message, but it does not wait until the it is also done with its call back function, right?

Asked by azerila on 2020-04-25 10:30:56 UTC

Answers