Supports subdirectories in msg folder#821
Supports subdirectories in msg folder#821ryought wants to merge 1 commit intoRobotWebTools:developfrom
Conversation
|
@ryought Thx for the PR. We've been heads down getting the update to node16 in place. Will review asap (next few days). |
|
@wayneparrott Thanks for your reply. I forgot to change to the ready-to-review PR. Could you check/review this PR? |
|
@ryought apologies for the slow follow up. When I read the initial PR comment it referenced a tutorial that I assumed demonstrated a subfolder hierarchy for msg IDL files. After looking at the tutorial it promotes the classic convention of msg idl files residing in a subdirectory of depth 1, i.e., msg/<myinterface>.msg and not msg/subfolder/<myinterface>.msg. You ref'ed the open ros2/rosidl#213 where the team is reluctant to add the support you are seeking. Without core ros2 level support I don't see how rclnodejs would be able to support this proposal (maybe I'm missing something here). I ran a quick experiment where I created a ros2 package named After updating my CMakefile to include Interesting to see Next I output the interfaces individually: Flakey results that lead me to believe there are other issues waiting to be discovered that will result from unconventional msg file organization. In general I'm NOT excited about rclnodejs taking up a feature not generally supported in ros2 and that the ros2cli doesn't support. With that I'll defer to @minggangw for his insights and direction. |
|
Thanks for @wayneparrott trying to verify it. The rclnodejs depends on rosidl to generate the typesupport libraries ( |
Public API Changes
None
Description
Fixed the
generate-ros-messagescommand not working properly if the msg file is in a subdirectory inside the msg directory.For example, consider the following simple ROS2 package.
This is the example package used in the ros2 tutorial, but has two message definitions, one is in the subdirectory
bar.After the
npx generate-ros-messagesis executed for this package,which comes from these msg files after build
are generated under
generated/folder. The first one should betutorial_interfaces__msg__Bar.js, but is named incorrectly, so the messageBarcannot be used in publisher or listener.So I changed
rosidl_gen/packages.jsso that it works even if some messages are in subdirectories.Caveats: This modification does not work for services in subdirectories and only supports messages in subdirectories.
Related issues
RobotWebTools/ros2-web-bridge#175
ros2/rosidl#213