eProsima Fast DDS

repository·master·Indexed 25 days ago

https://github.com/eprosima/fast-dds

A 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.

Tokens
14K
Snippets
20
Records
121
Agent score
83%

What's inside eProsima Fast DDS

  1. Use the Fast DDS Discovery Server CLI tool

    master

    The fastdds discovery tool 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]
  2. Understand the foonathan_memory dependency in Fast DDS

    master
    Fast DDS uses foonathan_memory as an external C++ dependency to manage memory allocations and improve upon the STL. To ensure stability, Fast DDS pins to a specific release of foonathan_memory (currently version v0.7-3) and uses the foonathan_memory_vendor utility to manage it. This approach ensures API and ABI stability within the Fast DDS ecosystem.
  3. Understand Static EDP discovery behavior

    master

    In 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 -h or --help flags.
  4. Understand Fast DDS platform support tiers

    master

    Fast 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.
  5. Understand Content Filtered Topics in Fast DDS

    master

    Content 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_list is 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).
  6. Understand the X-Types example

    master

    The xtypes example demonstrates how to use Dynamic Types binding and remote type discovery in eProsima Fast DDS.

    Key features demonstrated:

    1. Runtime Type Creation: The publisher creates a type at runtime using the Fast DDS Dynamic Types API (via C++ API or XML).
    2. 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.
    3. Interoperability: This example is fully type-compatible with the standard hello_world example; you can run a xtypes publisher with a hello_world subscriber and vice versa.
  7. Subscription paradigms: Listening Callbacks vs Wait-sets

    master

    The Hello World example demonstrates two ways to handle incoming data in a subscriber:

    1. 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.
    2. 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 --waitset or -w flag when running the subscriber.

  8. Implement a custom IPayloadPool

    master

    In Fast DDS, a Payload is the data transmitted between a DataWriter and a DataReader. To manage the lifecycle of these payloads, DDS uses a pool object that implements the IPayloadPool interface.

    By implementing IPayloadPool, you can optimize how memory is reserved and freed for payloads. You can then provide your custom implementation to the create_datawriter() and create_datareader() functions. Once provided, the DataWriter and DataReader will use your custom pool whenever a new change in their history is requested or released.

  9. Configure Flow Controllers to manage bandwidth

    master
    Flow 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.
  10. Manage Discovery Server Daemons

    master

    The 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 -d or --domain flag (equivalent to setting ROS_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.