Skip to content

Commit

Permalink
Re-enable hardware_sim test on macOS Sequoia and add documentation (R…
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-yankee authored Feb 7, 2025
1 parent 1c496a3 commit 7713cb3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
30 changes: 30 additions & 0 deletions doc/_pages/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,36 @@ Note that the concurrency level passed to `make` (e.g., `make -j 2`) does not
propagate through to affect the concurrency of most of Drake's build steps; you
need to configure the dotfile in order to control the build concurrency.

# Network Configuration

## LCM on macOS {#lcm-macos}

When building and testing Drake from source on macOS 15 (Sequoia), you may
encounter issues with [LCM](https://lcm-proj.github.io/lcm/index.html).
In particular, an error message that can arise is: "LCM self test failed!!
Check your routing tables and firewall settings." LCM relies on
[UDP Multicast](https://lcm-proj.github.io/lcm/content/multicast-setup.html)
over loopback, so multicast traffic must be enabled over the loopback
interface on your computer in order for it to work.

Sometimes this is not explicitly enabled on macOS. If you see this error,
check the routing table by running `netstat -nr`. The following entry in the
IPv4 table is correct:

```
Internet:
Destination Gateway Flags Netif Expire
...
224.0.0/4 lo0 UmS lo0
```

If you see a different interface for this address, such as `en0`, then
run the following to change it to loopback (`lo0`):

```
sudo route -nv delete 224.0.0.0/4
sudo route -nv add -net 224.0.0.0/4 -interface lo0
```

<!-- Links to the various Drake doxygen pages.
Order determined by directory structure first and names second.
Expand Down
11 changes: 0 additions & 11 deletions examples/hardware_sim/test/hardware_sim_test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,16 @@

import copy
import os.path
import platform
import re
import shlex
import subprocess
import sys
import unittest

import yaml

from python.runfiles import Create as CreateRunfiles


def _is_macos_sequoia() -> bool:
if sys.platform == "darwin":
ver_str = platform.mac_ver()[0]
major = int(ver_str.split(".")[0])
return major == 15
return False


class HardwareSimTest:

def _find_resource(self, respath):
Expand Down Expand Up @@ -91,7 +81,6 @@ def test_OneOfEverything(self):
"""Tests the OneOfEverything test scenario."""
self._run(self._test_scenarios, "OneOfEverything")

@unittest.skipIf(_is_macos_sequoia(), "LCM problems cause a segfault")
def test_Demo(self):
"""Tests the Demo example."""
self._run(self._example_scenarios, "Demo")
Expand Down
3 changes: 3 additions & 0 deletions lcm/drake_lcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace lcm {
*
* See \ref allow_network "DRAKE_ALLOW_NETWORK" for an environment variable
* option to disable LCM network traffic (i.e., only allowing `memq://` URLs).
*
* For network issues on macOS, see
* https://drake.mit.edu/troubleshooting.html#lcm-macos.
*/
class DrakeLcm : public DrakeLcmInterface {
public:
Expand Down

0 comments on commit 7713cb3

Please sign in to comment.