RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/humble/Concepts/Basic/About-Client-Libraries.html?highlight=rclnodejs#community-maintained
Apache License 2.0
311 stars 70 forks source link

Pass the subfolder of the service event location #957

Closed minggangw closed 4 months ago

minggangw commented 4 months ago

Per current implementation, when constructing the service event JavaScript file, we suppose the subfolder of the service event is "srv", but some package, e.g., slam_toolbox, the .srv files are put under srvs/ folder, so when requiring the service event, slam_toolboxsrvsAddSubmap_Event.js, it will imports the requst file, which is slam_toolboxsrvAddSubmap_Request.js, and lead to an error.

This patch passes the subfolder to the spec when creating the service event JS file, so it can require the request/response files by a correct file name.

Fix: #955