Disable latching for rostopic in piping mode
Is it possible?
The wiki states there are three modes rostopic pub
can function in, however it is not clear whether Rate mode and Latch mode are mutually exclusive.
Here are some cases (EDITED):
# Latching
$ rostopic pub /str std_msgs/String "Hello world"
publishing and latching message. Press ctrl-C to terminate
^C
# Not latching
$ rostopic pub -r 10 /str std_msgs/String "Hello world"
<No output here>
^C
# Still not latching
$ rostopic pub -r 10 --latch /str std_msgs/String "Hello world"
<No output here>
^C
# Latching again
$ rostopic pub -r 10 /another_str std_msgs/String "Test" &
$ rostopic echo /another_str | rostopic pub -r 10 /str std_msgs/String
publishing and latching message for 3.0 seconds
publishing and latching message for 3.0 seconds
...
publishing and latching message for 3.0 seconds
^C
If it is by design, then what is the reason to latch piped messages by default?
EDIT: Opened a ticket
EDIT #2:
Here is a simple one-line test:
$ for i in {1..1000}; do printf "data: ${i}\n---\n"; sleep 0.5; done | rostopic pub /test std_msgs/UInt64 > /dev/null & sleep 2 && rostopic echo /test
[1] 12431
data: 1
---
data: 2
---
data: 3
---
data: 4
---
data: 5
---
^C
$ kill $!
From the next one we can see that every message is latched indeed for 3 seconds (note the delay before echo for 9 seconds):
$ for i in {1..1000}; do printf "data: ${i}\n---\n"; sleep 0.5; done | rostopic pub /test std_msgs/UInt64 > /dev/null & sleep 9 && rostopic echo /test
[1] 12605
data: 18
---
data: 19
---
data: 20
---
data: 21
---
^C
$ kill $!
Hope it helps
Thanks
Asked by Boris on 2013-03-24 21:17:20 UTC
Comments
According to the wiki, piped messages shouldn't be latched by default, yet I'm experiencing the same problem.
Asked by RafBerkvens on 2013-03-25 03:40:00 UTC
Please state how you tested for latching?
Asked by tfoote on 2013-03-26 16:07:13 UTC
@tfoote, it is solely based on the screen output of
rostopic pub
saying "publishing and latching message for 3.0 seconds" (for every single message). In non-piped-rate moderostopic
produce no output to the screen.Asked by Boris on 2013-03-26 16:18:39 UTC
I've edited the output for respective commands
Asked by Boris on 2013-03-26 16:52:54 UTC