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

team_communication: automatically detect target ip address #589

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

timonegk
Copy link
Member

Summary

Automatically detect the target address for team communication from the wifi interface using netifaces.
In case of any problem, the default address configured is used.

Related issues

Closes #578.

Checklist

  • Run colcon build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

@timonegk timonegk requested a review from texhnolyze July 20, 2024 08:29
self.logger.warn("Could not detect broadcast address, falling back to configured address")
self.target_ip = None
if self.target_ip is None:
self.target_ip: IPv4Address = IPv4Address(node.get_parameter("target_ip").value)

if self.target_ip.is_loopback:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you removed local_target_ports this whole block should also be removed

except (ImportError, ValueError, KeyError, AddressValueError):
self.logger.warn("Could not detect broadcast address, falling back to configured address")
self.target_ip = None
if self.target_ip is None:
Copy link
Member

Choose a reason for hiding this comment

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

self.target_ip may not exist at this point

# Automatically detect UDP broadcast address
detect_target_ip: true
wifi_interface: "wlp3s0"
# Fallback, only used if detect_target_ip is false. This should be the highest IP in the subnet e.g. 172.20.255.255
Copy link
Member

Choose a reason for hiding this comment

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

only used if detect_target_ip is false this is false or irritating.

Its used:

  • if detect_target_ip is false
  • if detect_target_ip is true, but auto-detection failed

@Flova
Copy link
Member

Flova commented Sep 25, 2024

What's the state with this PR? @timonegk

@timonegk
Copy link
Member Author

It is still relevant but the reviews must be addressed and it has to be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

Dynamically decide team communication IP
4 participants