Fix ros2 interface show for msg files in subfolders (humble)#1249
Open
xin700 wants to merge 1 commit into
Open
Fix ros2 interface show for msg files in subfolders (humble)#1249xin700 wants to merge 1 commit into
xin700 wants to merge 1 commit into
Conversation
Use rosidl_interfaces resource index instead of get_interface_path() so interface files under nested directories (e.g. msg-common/Foo.msg) resolve correctly. Backport of the approach from ros2cli#1205. Fixes ros2#1186
|
Tick the box to add this pull request to the merge queue (same as
|
fujitatomoya
left a comment
Collaborator
There was a problem hiding this comment.
1st we need to make sure to merge #1205 to the rolling branch, and then we can backport the fix to the downstream automatically. it looks like backport is straightforward, i do not think we need this backport PR.
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.
Summary
ros2 interface showfor packages that install interface files under nested subdirectories (e.g.msg-common/GenericObject.msginmrpt_msgs).rosidl_runtime_py.get_interface_path()with lookup via therosidl_interfacesament index resource, matching the approach in fix non standard interface locations. (#1186) #1205 (kilted backport).Fixes #1186
Problem
On Humble,
ros2 interface show mrpt_msgs/msg/GenericObjectfails withInvalidResourceName: //becauseget_interface_path()cannot resolve interfaces whose.msgfiles live outside the conventionalmsg/<Name>.msglayout.Solution
Use
ament_index_python.resources.get_resource('rosidl_interfaces', pkg_name)to find the installed interface file path, then open it from the package share directory.Test plan
ros2 interface show mrpt_msgs/msg/GenericObject # InvalidResourceName: //test_show_not_an_interfaceexpected error messagecolcon build --packages-select ros2interfacesucceedsros2interfaceCLI test suite (requiresros-humble-test-msgsin CI)Related
Backport of the fix approach from #1205 to the
humblebranch.Made with Cursor