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_fastrtps] Improve handling of dynamic discovery #653

Merged
merged 46 commits into from
Apr 8, 2023

Conversation

gbiggs
Copy link
Member

@gbiggs gbiggs commented Dec 14, 2022

This PR adds to rmw_fastrtps functionality necessary to support the improved handling of dynamic discovery.

It adds handling of the new discovery parameters passed down from rcl.

This implementation allows a host specified in static peers to be a host name or an IPv4 or an IPv6 addresses. It will automatically manage translating between these to ensure that the static peer is correctly identified, no matter what it reports itself as.

Current status: The desired functionality is mostly complete. Most of the entries in the goal matrix are working correctly. There is currently a bug where specifying a static peer appears to disable dynamic discovery. This needs to be resolved.

@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2023-02-16/29927/1

Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net>
@wjwwood wjwwood force-pushed the gbiggs/discovery-peers-specification branch from 3f2b322 to 24bdb5a Compare March 21, 2023 20:06
@wjwwood wjwwood marked this pull request as ready for review March 21, 2023 20:06
@wjwwood wjwwood requested a review from sloretz as a code owner March 21, 2023 20:06
arjo129 and others added 8 commits March 21, 2023 13:27
This commit adds support for using IP addresses to specify peers. It
also refactors out some networking function so that they can be used by
other files.

Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Two more to go.

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
See:
* ros2/rmw#349
* ros2/rcl#1038

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
@sloretz
Copy link
Contributor

sloretz commented Mar 25, 2023

@EduPonz Any ETA on when the changes from this branch eProsima/Fast-DDS@master...poc/ros2-iron-discovery-options will get merged into Fast-DDS? They're required for these discovery changes to work with Fast-DDS.

I'm hoping we can get this in before the upcoming ROS Iron RMW freeze deadline.

Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
rmw_fastrtps_cpp/test/test_get_native_entities.cpp Outdated Show resolved Hide resolved
rmw_fastrtps_shared_cpp/src/participant.cpp Outdated Show resolved Hide resolved
rmw_fastrtps_shared_cpp/src/participant.cpp Show resolved Hide resolved
Comment on lines +233 to +237
if (RMW_AUTOMATIC_DISCOVERY_RANGE_LOCALHOST == discovery_options->automatic_discovery_range) {
// Add localhost as a static peer
eprosima::fastrtps::rtps::Locator_t peer;
eprosima::fastrtps::rtps::IPLocator::setIPv4(peer, "127.0.0.1");
domainParticipantQos.wire_protocol().builtin.initialPeersList.push_back(peer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the case of RMW_AUTOMATIC_DISCOVERY_RANGE_SUBNET, if initialPeersList is not empty, we should add the default multicast address to it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To the initial peer list, or as a multicast locator? I assumed the latter in cf9bf83

Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
…ticast locator

Signed-off-by: Shane Loretz <sloretz@google.com>
eprosima::fastrtps::rtps::Locator_t locator;
eprosima::fastrtps::rtps::IPLocator::setIPv4(locator, 239, 255, 0, 1);
domainParticipantQos.wire_protocol()
.builtin.metatrafficMulticastLocatorList.push_back(locator);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the initialPeersList. Announcements are always sent to the initial peer list. When it is empty, the middleware sets its value to the metatrafficMulticastLocatorList.

So if we want to publish announcements to 192.168.1.10 and the multicast address, both should be in the initial peer list.

Suggested change
.builtin.metatrafficMulticastLocatorList.push_back(locator);
.builtin.initialPeersList.push_back(locator);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to Initial peers list instead in 9cec2d6

…c peers and SUBNET range

Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Copy link
Contributor

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

@sloretz
Copy link
Contributor

sloretz commented Apr 5, 2023

Need one small fix/enhancement to Fast-DDS eProsima/Fast-DDS#3437

@sloretz sloretz merged commit c83749a into rolling Apr 8, 2023
@delete-merged-branch delete-merged-branch bot deleted the gbiggs/discovery-peers-specification branch April 8, 2023 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants