Skip to content
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

RMW_DURATION_INFINITE constant - use in QoS API contracts #255

Conversation

emersonknapp
Copy link
Contributor

@emersonknapp emersonknapp commented Jul 31, 2020

Resolves #210
Depends on #298 (which resolves #215)

Create explicit RMW_DURATION_INFINITE constant for use in requesting/offering QoS policies with durations, to be used as the default value instead of 0. Enforce using these values in the API contract.

Linked PRs:

Note: non-linked followups:

  • ros2cli (print "Infinite" instead of constant literal value)
  • rosbag2 (interpret old implementation-specific "infinite" values and rewrite them as RMW_DURATION_INFINITE, for playback)

Testing

Gist:

Build:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@emersonknapp emersonknapp changed the title WIP proposal for infinite RMW time [proposal] for RMW_TIME_INFINITE constant and associated QoS API changes Jul 31, 2020
@emersonknapp emersonknapp changed the title [proposal] for RMW_TIME_INFINITE constant and associated QoS API changes [proposal] RMW_TIME_INFINITE constant and associated QoS API changes Jul 31, 2020
@emersonknapp emersonknapp changed the title [proposal] RMW_TIME_INFINITE constant and associated QoS API changes [proposal] RMW_TIME_INFINITY constant and associated QoS API changes Jul 31, 2020
rmw/include/rmw/types.h Outdated Show resolved Hide resolved
@emersonknapp
Copy link
Contributor Author

Closed by unintentional language in another PR comment - still working on this

@emersonknapp emersonknapp reopened this Jan 21, 2021
@emersonknapp
Copy link
Contributor Author

emersonknapp commented Feb 10, 2021

I am actively working on this right now (for any interested parties). I've gathered more information to illustrate how the RMW API is currently incomplete.

The following values are gathered from get_publishers_info_by_topic when a single publisher is publishing with unspecified Deadline duration. It doesn't matter which RMW implementation is being used to publish, the value only depends on the implementation of the subscripton - I have tested it with only Cyclone and FastDDS, with all 4 pub/sub combinations. These same values are reported for Deadline, Lifespan, and Liveliness Lease Duration

Value Type Fast sec Fast nsec Fast total nsec Cyclone sec Cyclone nsec Cyclone total nsec
decimal 2147483647 4294967295 2147483651294967295 9223372036 854775807 9223372036854775807
hex 0x7FFFFFFF 0xFFFFFFFF 0x1DCD6500C46535FF 0x225C17D04 0x32F2D7FF 0x7FFFFFFFFFFFFFFF
DDS IDL PSM Constant DURATION_INFINITE_SEC TIME_INVALID_SEC nothing nothing nothing nothing
int limits INT32_MAX UINT32_MAX (or -1) nothing nothing nothing INT64_MAX

"DDS IDL PSM Constant" above refers to the values laid out in Section 2.3.3 of the DDS 1.4 spec. From my understanding this PSM is meant to provide common interfaces for programming languages. There are separate docs available as well:

Based on the above information, the two implementations are providing values that are neither consistent with each other or guidelines from the specification - seems like we just have exposed implementation details.

My next step is an updated API proposal, which will come with coupled prototype PRs for the RMW implementations.

Interesting note: the IDL PSM specifies Durations as:

struct Duration_t {
  long sec;
  unsigned long nanosec;
};

But we use exclusively unsigned values within the RMW API.

@emersonknapp emersonknapp force-pushed the emersonknapp/define-rmw-infinity-time branch from 4494d8e to 6ce82d7 Compare February 10, 2021 08:02
@emersonknapp emersonknapp changed the title [proposal] RMW_TIME_INFINITY constant and associated QoS API changes [proposal] RMW_DURATION_INFINITE constant - use in QoS API contracts Feb 10, 2021
@emersonknapp emersonknapp marked this pull request as ready for review February 10, 2021 16:30
rmw/include/rmw/types.h Outdated Show resolved Hide resolved
@emersonknapp emersonknapp mentioned this pull request Feb 11, 2021
10 tasks
Emerson Knapp added 3 commits February 18, 2021 10:21
Signed-off-by: Emerson Knapp <[email protected]>
Signed-off-by: Emerson Knapp <[email protected]>
@emersonknapp emersonknapp force-pushed the emersonknapp/define-rmw-infinity-time branch from da71ce4 to 5faaf81 Compare February 18, 2021 18:35
@emersonknapp emersonknapp changed the title [proposal] RMW_DURATION_INFINITE constant - use in QoS API contracts RMW_DURATION_INFINITE constant - use in QoS API contracts Feb 18, 2021
@emersonknapp
Copy link
Contributor Author

Closing this in favor of #301 for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants