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

@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 <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Two more to go.

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Michael X. Grey <[email protected]>
@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.

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
Collaborator

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

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
Collaborator

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

Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Copy link
Collaborator

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

7 participants