eProsima Fast DDS
repository·master·Indexed 25 days ago
https://github.com/eprosima/fast-ddsA C++ implementation of the OMG DDS standard implementing the RTPS protocol for real-time publisher-subscriber communications. It serves as the default middleware for ROS 2. The documentation covers the use of benchmark and configuration examples to test transport behavior, throughput, and Quality of Service (QoS) settings including Reliability, Durability, Deadline, History, Lifespan, Liveliness, Ownership, and Partition.
What's inside eProsima Fast DDS
- Starting from version 2.10.0, secure communications are enabled on the Discovery Server (note: this introduced an ABI break on the RTPS layer).
Use the Fast DDS Discovery Server CLI tool
masterThe
fastdds discoverytool is an auxiliary generator used for deploying eProsima Discovery Servers and inspecting active ones. It can be run in a standard mode or as a daemon to manage server lifecycles and remote connections.fastdds discovery [optional parameters]Understand the foonathan_memory dependency in Fast DDS
masterFast DDS usesfoonathan_memoryas an external C++ dependency to manage memory allocations and improve upon the STL. To ensure stability, Fast DDS pins to a specific release offoonathan_memory(currently versionv0.7-3) and uses thefoonathan_memory_vendorutility to manage it. This approach ensures API and ABI stability within the Fast DDS ecosystem.Understand Static EDP discovery behavior
masterIn a static discovery deployment:
- The publisher will not start sending data until a subscriber is discovered.
- Once a match is established, both applications will log a match acknowledgment.
- When one application is stopped (e.g., via Ctrl+C), the other application will detect the unmatched status and stop sending or receiving samples.
- You can query all available arguments for the executable using the
-hor--helpflags.
Understand Fast DDS platform support tiers
masterFast DDS categorizes platform support into three tiers, which determines the level of testing, bug prioritization, and reliability you can expect:
- Tier 1: Fully supported. Subject to frequent unit testing, continuous integration (CI), nightly jobs, packaging, and performance testing. High-priority bugs are resolved before new releases.
- Tier 2: Periodically supported. Subject to periodic CI testing (builds and tests) with public results. Installation instructions must be up-to-date. Errors may exist in released versions and are addressed on a best-effort basis.
- Tier 3: Community-supported. The development team does not run automated tests on these platforms. Functionality is based on community reports.
Understand Content Filtered Topics in Fast DDS
masterContent Filtered Topics allow you to filter data based on its content. Filters can be applied on either the DataReader side or the DataWriter side.
Applying the filter on the Writer side can reduce network bandwidth usage but may increase CPU usage on the writer. For the DataWriter to take responsibility for filter evaluation instead of the DataReader, the following criteria must be met:
- The DataWriter has infinite liveliness (
LivelinessQosPolicy). - Communication is neither intra-process nor involves data-sharing.
- The DataReader is not utilizing multicast (
default_multicast_locator_listis empty). - The number of DataReaders being filtered does not exceed the limit set in
reader_filters_allocation(setting this to 0 disables writer-side filtering).
- The DataWriter has infinite liveliness (
Understand the X-Types example
masterThe
xtypesexample demonstrates how to use Dynamic Types binding and remote type discovery in eProsima Fast DDS.Key features demonstrated:
- Runtime Type Creation: The publisher creates a type at runtime using the Fast DDS Dynamic Types API (via C++ API or XML).
- Type Discovery: The subscriber discovers the type defined by the publisher, uses it to create a data reader, introspects the type, and prints the received data.
- Interoperability: This example is fully type-compatible with the standard
hello_worldexample; you can run axtypespublisher with ahello_worldsubscriber and vice versa.
Subscription paradigms: Listening Callbacks vs Wait-sets
masterThe Hello World example demonstrates two ways to handle incoming data in a subscriber:
- Listening Callbacks: A listener class is attached to the data reader. When an event occurs (like new data available), the listener's associated callback method is automatically triggered.
- Wait-sets: A dedicated thread waits for specific status conditions to occur. Once triggered, the thread evaluates the condition to determine the appropriate action.
To switch from the default listening callback mechanism to the wait-set approach in the example, use the
--waitsetor-wflag when running the subscriber.Implement a custom IPayloadPool
masterIn Fast DDS, a Payload is the data transmitted between a
DataWriterand aDataReader. To manage the lifecycle of these payloads, DDS uses a pool object that implements theIPayloadPoolinterface.By implementing
IPayloadPool, you can optimize how memory is reserved and freed for payloads. You can then provide your custom implementation to thecreate_datawriter()andcreate_datareader()functions. Once provided, theDataWriterandDataReaderwill use your custom pool whenever a new change in their history is requested or released.Configure Flow Controllers to manage bandwidth
masterFlow Controllers allow you to control bandwidth usage and avoid data bursts. You can specify the maximum amount of data to be sent in a specific period of time, which is particularly useful when sending large messages that require fragmentation.Manage Discovery Server Daemons
masterThe tool provides daemon commands to manage the Discovery Server lifecycle and remote server connections. All daemon commands can be scoped to a specific DDS domain using the
-dor--domainflag (equivalent to settingROS_DOMAIN_ID).Daemon Commands:
auto: Handles daemon start-up automatically.start: Starts the Discovery Server daemon with specified remote connections. Example:start -d 2 127.0.0.1:3.stop: Stops the active Discovery Server daemon.add: Adds new remote Discovery Servers to the local server without modifying existing remotes.set: Replaces existing remote Discovery Server connections with a new set of connections.list: Lists local active discovery servers created via this CLI tool.
Install eProsima Fast DDS
masterYou can install eProsima Fast DDS by either using binary distributions or by compiling the library from source.
For complete installation instructions, including binary installation for specific operating systems, refer to the official Fast DDS documentation.