Skip to content

Avah/macos fix gamecontroller interface#3838

Closed
williamckha wants to merge 4 commits into
UBC-Thunderbots:masterfrom
nycrat:avah/macos_fix_gamecontroller_interface
Closed

Avah/macos fix gamecontroller interface#3838
williamckha wants to merge 4 commits into
UBC-Thunderbots:masterfrom
nycrat:avah/macos_fix_gamecontroller_interface

Conversation

@williamckha

Copy link
Copy Markdown
Member

Description

Original PR merged into robocup_2026: #3819

Discovered this cause we don't have good wifi here at robocup, found out by turning off wifi macos can't use the en0 interface which is referenced in gamecontroller binary context manager. This PR uses netifaces to get primary interface instead of relying on en0 for macos, this does not need to be changed on linux since the multicast messages get sent to the loopback interface.

Testing Done

Without the changes, running ./tbots.py run thunderscope --enable_autoref with wifi turned off results in this error:

Traceback (most recent call last):
  File "/private/var/tmp/_bazel_avah/c66e7f3b6f9fffee22646d89d33fc0ae/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/software/thunderscope/thunderscope_main.runfiles/_main/software/thunderscope/thunderscope_main.py", line 483, in <module>
    gamecontroller.setup_proto_unix_io(
  File "/private/var/tmp/_bazel_avah/c66e7f3b6f9fffee22646d89d33fc0ae/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/software/thunderscope/thunderscope_main.runfiles/_main/software/thunderscope/binary_context_managers/game_controller.py", line 253, in setup_proto_unix_io
    self.receive_referee_command = tbots_cpp.SSLRefereeProtoListener(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
software.python_bindings.TbotsNetworkException: Could not find the local ip address for the given interface: en0

After the changes, everything works including gamecontroller.

NOTE: there is an additional bug fix for a bug introduced in #3766 about gamecontroller ports

Resolved Issues

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

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.

2 participants