Skip to content
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

Pass the subfolder of the service event location #957

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rosidl_gen/idl_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ async function generateServiceEventMsg(serviceInfo, dir) {

async function generateServiceEventJSStruct(msgInfo, dir) {
const spec = await parser.parseMessageFile(msgInfo.pkgName, msgInfo.filePath);
// Pass `msgInfo.subFolder` to the `spec`, because some .srv files of the
// package may not be put under srv/ folder, e.g., slam_toolbox.
spec.subFolder = msgInfo.subFolder;

// Remove the `.msg` files generated in `generateServiceEventMsg()` to avoid
// being found later.
Expand Down
2 changes: 1 addition & 1 deletion rosidl_gen/templates/message.dot
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function getModulePathByType(type, messageInfo) {

/* We should use '__msg__' to require "service_msgs/msg/ServiceEventInfo.msg" for service event message. */
if (messageInfo && messageInfo.isServiceEvent && (type.type !== 'ServiceEventInfo')) {
return type.pkgName + '__srv__' + type.type + '.js';
return type.pkgName + `__${it.spec.subFolder}__` + type.type + '.js';
}
return type.pkgName + '__msg__' + type.type + '.js';
}
Expand Down
Loading