Skip to content

Commit

Permalink
Use interface kind names properly in ROS2 interface type names. (#194)
Browse files Browse the repository at this point in the history
Follow up after 816b667.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic authored May 15, 2019
1 parent 536396d commit 7f3756e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions resource/get_mappings.cpp.em
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ get_1to2_mapping(const std::string & ros1_type_name, std::string & ros2_type_nam
@[for m in mappings]@
if (ros1_type_name == "@(m.ros1_msg.package_name)/@(m.ros1_msg.message_name)")
{
ros2_type_name = "@(m.ros2_msg.package_name)/@(m.ros2_msg.message_name)";
ros2_type_name = "@(m.ros2_msg.package_name)/msg/@(m.ros2_msg.message_name)";
return true;
}
@[end for]@
Expand All @@ -51,7 +51,7 @@ get_2to1_mapping(const std::string & ros2_type_name, std::string & ros1_type_nam
@[end if]@

@[for m in mappings]@
if (ros2_type_name == "@(m.ros2_msg.package_name)/@(m.ros2_msg.message_name)")
if (ros2_type_name == "@(m.ros2_msg.package_name)/msg/@(m.ros2_msg.message_name)")
{
ros1_type_name = "@(m.ros1_msg.package_name)/@(m.ros1_msg.message_name)";
return true;
Expand All @@ -67,7 +67,7 @@ get_all_message_mappings_2to1()
static std::map<std::string, std::string> mappings = {
@[for m in mappings]@
{
"@(m.ros2_msg.package_name)/@(m.ros2_msg.message_name)", // ROS 2
"@(m.ros2_msg.package_name)/msg/@(m.ros2_msg.message_name)", // ROS 2
"@(m.ros1_msg.package_name)/@(m.ros1_msg.message_name)" // ROS 1
},
@[end for]@
Expand All @@ -81,7 +81,7 @@ get_all_service_mappings_2to1()
static std::map<std::string, std::string> mappings = {
@[for s in services]@
{
"@(s['ros2_package'])/@(s['ros2_name'])", // ROS 2
"@(s['ros2_package'])/srv/@(s['ros2_name'])", // ROS 2
"@(s['ros1_package'])/@(s['ros1_name'])" // ROS 1
},
@[end for]@
Expand Down
4 changes: 2 additions & 2 deletions resource/interface_factories.cpp.em
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ get_factory_@(ros2_package_name)__@(interface_type)__@(interface.message_name)(c
if (
(ros1_type_name == "@(m.ros1_msg.package_name)/@(m.ros1_msg.message_name)" ||
ros1_type_name == "") &&
ros2_type_name == "@(m.ros2_msg.package_name)/@(interface_type)/@(m.ros2_msg.message_name)")
ros2_type_name == "@(m.ros2_msg.package_name)/msg/@(m.ros2_msg.message_name)")
{
return std::make_shared<
Factory<
Expand Down Expand Up @@ -86,7 +86,7 @@ get_service_factory_@(ros2_package_name)__@(interface_type)__@(interface.message
) || (
ros_id == "ros2" &&
package_name == "@(service["ros2_package"])" &&
service_name == "@(service["ros2_name"])"
service_name == "srv/@(service["ros2_name"])"
)
) {
return std::unique_ptr<ServiceFactoryInterface>(new ServiceFactory<
Expand Down

0 comments on commit 7f3756e

Please sign in to comment.