Skip to content

Commit 07dc1f6

Browse files
yumeminamifengrongman
andauthored
fix: fix mapping service rules not work in customize msg type (#456)
Co-authored-by: fengrongman <fengrongman@lejurobot.com>
1 parent 6c5ad16 commit 07dc1f6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

resource/interface_factories.cpp.em

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,14 @@ void ServiceFactory<
321321
@[ if field["basic"]]@
322322
@(field["ros2"]["name"])@(to) = @(field["ros1"]["name"])@(frm);
323323
@[ else]@
324-
Factory<@(field["ros1"]["cpptype"]),@(field["ros2"]["cpptype"])>::convert_@(frm)_to_@(to)(@
325-
@(field["ros2"]["name"])@(frm), @(field["ros1"]["name"])@(to));
324+
Factory<@(field["ros1"]["cpptype"]),@(field["ros2"]["cpptype"])>::convert_@(frm)_to_@(to)(
325+
@[ if frm == "1"]@
326+
@(field["ros1"]["name"])1, @(field["ros2"]["name"])2
327+
@[ else]@
328+
@(field["ros2"]["name"])2, @(field["ros1"]["name"])1
329+
@[ end if]@
330+
);
331+
326332
@[ end if]@
327333
@[ if field["array"]]@
328334
}

0 commit comments

Comments
 (0)