-
Notifications
You must be signed in to change notification settings - Fork 0
Macos hardware plugin link #47
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,11 +33,39 @@ target_include_directories(lucy_ros2_control PUBLIC | |
| $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/include> | ||
| $<INSTALL_INTERFACE:include/lucy_ros2_control> | ||
| ) | ||
| ament_target_dependencies( | ||
| lucy_ros2_control PUBLIC | ||
| ${THIS_PACKAGE_INCLUDE_DEPENDS} | ||
| # Link the namespaced CMake targets rather than ament_target_dependencies. | ||
| # ament_target_dependencies expands to each dependency's full ament link list, | ||
| # which includes its <msg>__rosidl_generator_py libraries. Those are built to be | ||
| # loaded inside a Python interpreter: they carry undefined _Py* symbols and | ||
| # deliberately do not link libpython. Dragging them into a C++ plugin makes | ||
| # macOS's flat-namespace dlopen fail to resolve them, so pluginlib rejects the | ||
| # hardware component with "symbol not found in flat namespace | ||
| # '_PyExc_RuntimeError'" and controller_manager never loads any hardware. | ||
| target_link_libraries(lucy_ros2_control PUBLIC | ||
| hardware_interface::hardware_interface | ||
| pluginlib::pluginlib | ||
| rclcpp::rclcpp | ||
| rclcpp_lifecycle::rclcpp_lifecycle | ||
| ) | ||
|
|
||
| if(APPLE) | ||
| # Those dependencies expand to each message package's __rosidl_generator_py | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
| # library. Those are built to be loaded inside a Python interpreter: they carry | ||
| # undefined _Py* symbols and deliberately do not link libpython, because in | ||
| # `python3` the symbols are already in the process. | ||
| # | ||
| # This plugin uses no symbol from any of them, but they still land in its load | ||
| # commands. ros2_control_node is pure C++, so when pluginlib dlopen()s the | ||
| # plugin the flat-namespace lookup for '_PyExc_RuntimeError' finds nothing and | ||
| # the hardware component is rejected — controller_manager then loads no | ||
| # hardware, spawns no controllers, and nothing publishes /joint_states. | ||
| # | ||
| # -dead_strip_dylibs drops dylibs no symbol is used from, removing them before | ||
| # they can be loaded. Linux binds these lazily and never hits this, so keep the | ||
| # flag APPLE-only. | ||
| target_link_options(lucy_ros2_control PRIVATE "LINKER:-dead_strip_dylibs") | ||
| endif() | ||
|
|
||
| # Export hardware plugins | ||
| pluginlib_export_plugin_description_file(hardware_interface lucy_ros2_control.xml) | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment too long