Repository navigation
webots_ros2_driver on macOS - #115
Draft
Tobias-Fischer wants to merge 3 commits into
Draft
Tobias-Fischer wants to merge 3 commits into
Tobias-Fischer wants to merge 3 commits into
Conversation
For #102 (upstream WIP: cyberbotics/webots_ros2#733). The bundled Webots controller library builds on macOS, but its Makefiles assume the app bundle layout and universal binaries: - map Contents/ onto the plain layout (symlink) and install the launcher from MacOS/; plain @rpath install names and @loader_path rpaths - build only the target architecture under conda (target_platform), and link without an explicit -target (conda's clang++ then rejects libLTO) - build the launcher with $(CC) and header padding for install_name_tool - Ros2LightSensor: fix chained comparisons (a < x < b), rejected by clang 21 Only webots_ros2_driver is selected on macOS; webots_ros2 stays linux-64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found running the webots_ros2_mavic demo against Webots R2025a on macOS: - utils.py: Webots.app's version.txt is in Contents/Resources - webots_launcher.py: start Contents/MacOS/webots - controller/wb.py, vehicle/driver.py: the ROS nodes point WEBOTS_HOME at this package's prefix, so load the controller libraries from lib/controller - Driver.cpp: the /proc/<pid>/cmdline check (only for a deprecation warning) is Linux-only; without /proc it aborted the driver - webots_ros2_importer: run-depend on pillow (urdf2webots imports PIL; the package.xml doesn't declare it, on any platform) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…[skip ci] Turns the local checks of this PR into a recipe test, so later rebuilds keep them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #102: builds
webots_ros2_driveron macOS. Upstream's macOS work (cyberbotics/webots_ros2#733) is a stalled WIP; this takes a smaller route. The bundled Webots controller library compiles on macOS as is, but its Makefiles assume the app bundle layout and universal binaries. The patch (all distributions, applies to their sync versions):Contents/onto the plain layout (webots/Contents -> .) and installswebots-controllerfromMacOS/;@rpath/<lib>install names and@loader_pathrpaths for the controller libraries and the driver executables (instead of$ORIGIN);target_platform), builds only the target architecture and links without an explicit-target(conda's clang++ then rejects its libLTO);$(CC)and header padding (it used the systemgcc, and rattler-build's relinking failed);Ros2LightSensor.cpp: fixes chained comparisons (a < x < b), an upstream bug that clang 21 rejects (GCC only warns).utils.pyfinds Webots.app'sContents/Resources/version.txt, the launcher startsContents/MacOS/webots, the Pythoncontroller/vehiclemodules load the bundled libraries fromlib/controller, andDriver.cpp's/proc/<pid>/cmdlinecheck (only for a deprecation warning) is Linux-only.webots_ros2_importer: run-depends onpillow(urdf2webotsimportsPIL; the package.xml doesn't declare it, on any platform).Only
webots_ros2_driveris selected on macOS;webots_ros2stays linux-64. Linux builds use the same CMake paths as before ($ORIGIN,webots/webots-controller).Recipe test: the bundled controller library (
lib/controller/libController.*) is installed andwebots_ros2_driver.utilsimports (shared/tests/ros2-webots-ros2-driver.yaml).Built locally
webots_ros2_driverincl. recipe tests, and end to end with Webots R2025a (nightly) and thewebots_ros2_mavicdemo (built locally for this test; only the driver is selected on macOS): the controller connects, the Mavic's camera (~124 Hz), GPS, compass and IMU topics publish, and/cmd_velmakes it climb (GPS z 0.78 → 2.28 m). (The R2025a release build didn't start on this Mac at all, independent of ROS: it failed to open any TCP port.)webots_ros2_driver(2025.0.0 patch) incl. recipe tests.webots_ros2_driverincl. recipe tests.Prepared and built on top of the current rosdistro syncs (#62 humble, #61 jazzy, #60 lyrical, #99 rolling) merged together, so it targets their package versions: merge after them. CI is held with
[skip ci]until the syncs are in. The jazzy sync (#61) also changes jazzy's patch; rebase after it merges.🤖 Generated with Claude Code