Closed knorth55 closed 1 year ago
@mjcarroll can you review this PR? this first topic drop causes unintended robot behavior.
Our case:
In our lab, we use mux
for speech-to-text
result, because there are several running speech-to-text
engines to select.
When a person talk to the robot, the robot always ignore the person at first, which is caused by this first topic drop.
Therefore, we need to speak the same thing twice when mux
start publishing the topic.
In order to avoid this behavior, we make this wait_publisher_initialization
option for mux
.
This PR does not change the default behavior.
@peci1 Thank you for your advice! I add wait_publisher_second
param
mux
node does not havesleep
betweenadvertise
andpublish
. this causes dropping first message publication. this does not matter when the topic's frequency is high. but when the topic's frequency is low, dropping the first message causes huge time loss.This PR add option to add
0.1ms
sleep betweenadvertise
andpublish
. This change avoids dropping the first message.How to test
Sample launch
Publish topic in 10 second. without this PR, the first message of
/node_mux
will drop, so we need to wait 20 seconds to get/node_mux
topic.wait_publisher_initialization
: true (this PR)After 10 seconds,
/node1
,/node2
and/node_mux
arrived!wait_publisher_initialization
: false (current behavior)After 10 seconds,
/node1
and/node2
arrive, but/node_mux
did not arrived.