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

Use interface kind names properly in ROS2 interface type names. #194

Merged
merged 1 commit into from
May 15, 2019
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
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