-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid message loss when dumping CAN traffic via YARP ports #259
Comments
Better "fast_tcp" than "tcp", see Port and connection protocols, Configuring YARP Connections and robotology/community#258. |
Tested on the left arm. With With Results are similar on current master and the WIP feature branch associated to this issue. PS there is little impact when dropping |
Done at f324d11. The dumpCanBus app has learned to accept a new switch, |
See robotology/yarp#2533 regarding CPU usage on buffered ports with no active connection. |
As observed in #160 (comment), the
/dump:o
port publishes at such a high rate that messages are dropped/lost when inspected either throughyarp read
companion command or the dumpCanBus app.I have replicated this behavior in a reader&writer sample scenario:
Command-line arguments allow to tweak the number of messages sent in bursts (default: 10), the delay between messages (default: 0.1 seconds), whether the writer should wait for any writes to complete (default: false), and whether the reader should not drop old messages (default: false). Note the reader also emulates an intensive operation going on each message reception (default: 10 ms).
Per docs:
Our problem is mostly solved with
write(true)
(orwriteStrict()
) andsetStrict(true)
. I observe that messages are dropped whenever any of these is not properly set.Ideas:
writeStrict()
in CanBusControlboard's CAN read/write threads.setStrict()
in dumpCanBus. See warning: "if you can't read them as fast as they come in, watch out".write()
multiple times: read loop, write loop). Consequently, dumpCanBus should be prepared to accept and decode multiple-list bottles.writeStrict()
degrades performance, consider alternatives (aggressive buffering? lower CAN read/write rates?) and/or conditionally disable dump port.By the way, I could have used
setWriteOnly()
instead ofsetInputMode()
here.Also, CAN messages forwarded via YARP could have a timestamp envelope associated and printed on screen by dumpCanBus, if properly configured.
The text was updated successfully, but these errors were encountered: