-
Notifications
You must be signed in to change notification settings - Fork 774
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
Errors sending large data #83
Comments
Probably the UDP buffers overflow. Use a throughputController for your publisher, see documentation (I'm using a wrapper so I don't know the code by heart). Keep the period small and set a useful amount of bytes. |
Do you still notice the problem with last version of Fast RTPS? This version fixes several bugs and introduces piggyback heartbeats to improve sending of large data. |
Sorry, I close the issue accidentally |
Is this issue resolved? I am trying to do something similar but using the RTPS layer. An example program is attached, following guidelines for sending large files in the user manual. Can you spot what is it that I am doing wrong? Thanks. |
Just to add, for payload sizes just above 65kB, I do get the following error messages on the writer side:
These messages do not appear if the payload is much larger (for example: 640x480 - as in sending a VGA grayscale image - the above test program was derived from such a use case, with reliability set to BEST_EFFORT) Also, when the writer is pushing messages out in a loop (as you would do with a camera driver), RTPS consumption of system memory explodes within a few seconds and consumes all RAM) Vilas |
The error message is shown because the CacheChange cannot be inserted entirely in a RTPS message. In low level RTPS API when a user works with a CacheChange, he should specify if the CacheChange has to be fragmented. In Pub/Sub API this is done automatically by the library. You can introduce this code line when using a CacheChange: pChange->setFragmentSize(64000); About the memory increasing, the history attribute while (pChange == nullptr)
{
pWriter->remove_older_changes(nMaxChangesToRemove);
++nRemoved;
pChange = pWriter->new_change(dataSizeFunc, ChangeKind_t::ALIVE);
} If you set the history attribute to 1, for example, the internal CacheChange pool only mateins one CacheChange. |
Sorry, I am still not able to see any received messages on the reader end. Is there anything special I have to do other than setFragmentSize(). Reader's |
@cvilas You may want to try enabling asynchronous publishing mode on your publisher. This is required for sending data larger than a single UDP packet (or perhaps in this case, the user specified fragment size). When I originally tried to stream video way back when, I didn't know about the setFragmentSize call, so maybe these two things combined are the magic words to get this working? // Asynchronous Publish Mode
pubAttr.qos.m_publishMode.kind = ASYNCHRONOUS_PUBLISH_MODE;
mp_publisher = Domain::createPublisher( mp_participant, pubAttr, nullptr ); With RTI's implementation, I usually set my fragment size to: <element>
<name>dds.transport.UDPv4.builtin.parent.message_size_max</name>
<!-- 64 KB minus header sizes -->
<value>65507</value>
</element> |
@spiderkeys Thanks. I am working with the RTPS layer rather than pub/sub api (which apparently doesn't require setFragmentSize to be called anyway). The asynchronous mode is set on the writer and when registering with the participant. The pub/sub API would be simpler to use I suppose, but I am now committed to using the RTPS layer due to various design choices we made on our end. |
@cvilas Are you using the same example you attached? I've added the lines I told you and it's working: 83c83
< historyAttr.maximumReservedCaches = 0;
---
> historyAttr.maximumReservedCaches = 1;
194c194
< historyAttr.maximumReservedCaches = 0;
---
> historyAttr.maximumReservedCaches = 1;
279a280
> pChange->setFragmentSize(64000); @spiderkeys He is not using the Pub/Sub API. He is using a low level API that is slightly different. But he enables the asynchronous writing. Thanks for your answer. |
Indeed, it does work! Thanks. I am not sure what I was looking at just a moment ago. Perhaps time for a coffee break. Thanks very much @richiware. I appreciate your time on the issue. |
I can confirm that I can reliably transmit 10MB data between RTPS readers and writers, and also transmit 640*480 VGA image data at 50 fps in best-effort mode - the two scenarios described in the user manual. Thanks again @richiware @spiderkeys |
Since all the users involved seem happy with the solution provided, I close this (very) old issue |
Context: Sending video data with each sample being up to 150Kb in size. The first several frames go through, followed by failures on almost every other frame. data_msg_length has a peculiar value of ~ULONG_MAX. It was my understanding that the one step required for large data is to set the publisher mode to asynchronous to allow for fragmentation. Please let me know if I have set up anything incorrectly here.
IDL definition:
Following is the setup:
Sending data:
Added logging at this location:
https://github.com/eProsima/Fast-RTPS/blob/master/src/cpp/rtps/messages/RTPSMessageGroup.cpp#L240
The resulting output:
The text was updated successfully, but these errors were encountered: