ros2 / rmw

The ROS Middleware (rmw) Interface.
Apache License 2.0
95 stars 67 forks source link

Add call-through function for notifying about network interfaces #344

Open jakymiws opened 1 year ago

jakymiws commented 1 year ago

Related to: https://github.com/ros2/rcl/pull/1028 https://github.com/ros2/rmw_fastrtps/pull/662 https://github.com/ros2/rmw_implementation/pull/213 https://github.com/ros2/rclcpp/pull/2086

clalancette commented 1 year ago

@jakymiws Can you please give us an overview of what you are attempting to accomplish with this series of PRs?

jakymiws commented 1 year ago

@jakymiws Can you please give us an overview of what you are attempting to accomplish with this series of PRs?

The goal is to be able to call into fast-dds to get it to re-scan network interfaces. The specific feature in question is enabled by calling the set_qos function as documented here: https://fast-dds.docs.eprosima.com/en/latest/fastdds/use_cases/dynamic_network_interfaces/dynamic_network_interfaces.html#dynamic-network-interfaces

alsora commented 1 year ago

@fujitatomoya sure, we can definitely have a discussion during the next middleware WG.

The use-case is the following: all the existing DDS implementations currently scan for available network interfaces only once, i.e. when a DDS participant is created. This usually happens when you call rclcpp::init(). If a network interface is not available at that time it will be ignored. For example: you start a ROS application, then you bring up WiFi -> the ROS application will not use WiFi.

We had a discussion in the past about how to get around this and it is ultimately problematic for the middlewares to know whether they have to wait for interfaces, keep scanning for them, republish messages on new interfaces etc. This API is a trigger to tell the middleware to scan for existing interfaces.

The current default RMW implementation (Fast-DDS) supports this feature: https://fast-dds.docs.eprosima.com/en/latest/fastdds/use_cases/dynamic_network_interfaces/dynamic_network_interfaces.html#dynamic-network-interfaces

fujitatomoya commented 1 year ago

@alsora appreciate the information, thanks for sharing. apparently we almost have the same use cases 😄

I have considered this kind of feature before, so posting my note here. hopefully this could bring more discussion.

Network Detection / Awareness

Overview

I just want to come up with questions and possible requirements in robots, robotics and edge devices. As described below, nodes could be connected, disconnected or transited the network status based on dynamic physical environment.

image

Possible Situations

Requirements / Capabilities

Consideration / Note

Currently i was thinking that this is doable with following and restarting ROS 2 node (DDS participants), but happy to discuss.

ros-discourse commented 1 year ago

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

https://discourse.ros.org/t/network-issues-ros-topic-visibility-dependency-to-network-interfaces/29385/2

fujitatomoya commented 1 year ago

@alsora quick question, i think that @wjwwood mentioned in MW WG today. How we(application or DDS) can get the event that network configuration changed? is there already some APIs or interfaces provided by Fast-DDS?

mauropasse commented 1 year ago

@fujitatomoya there are currently no APIs on Fast-DDS to be notified about a change on the network interfaces. They did a quick investigation about it, but would only apply for Linux and wouldn't work in an platform agnostic way.

ros-discourse commented 1 year ago

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