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

[backport dashing] fix showing duplicate keys in --print-pairs #230

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions include/ros1_bridge/bridge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ get_2to1_mapping(
const std::string & ros2_type_name,
std::string & ros1_type_name);

std::map<std::string, std::string>
std::multimap<std::string, std::string>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API change is necessary to get the necessary information to fix --print-pairs. Either we are ok with that API breakage (and notify users in the sync email about it) or we should close this backport and leave the --print-pairs in the broken state in Dashing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would vote for closing to avoid API changes, or add a new function (different name) only in dashing and update our code to use that one instead.

get_all_message_mappings_2to1();

std::map<std::string, std::string>
std::multimap<std::string, std::string>
get_all_service_mappings_2to1();

std::shared_ptr<FactoryInterface>
Expand Down
8 changes: 4 additions & 4 deletions resource/get_mappings.cpp.em
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ get_2to1_mapping(const std::string & ros2_type_name, std::string & ros1_type_nam
return false;
}

std::map<std::string, std::string>
std::multimap<std::string, std::string>
get_all_message_mappings_2to1()
{
static std::map<std::string, std::string> mappings = {
static std::multimap<std::string, std::string> mappings = {
@[for m in mappings]@
{
"@(m.ros2_msg.package_name)/msg/@(m.ros2_msg.message_name)", // ROS 2
Expand All @@ -75,10 +75,10 @@ get_all_message_mappings_2to1()
return mappings;
}

std::map<std::string, std::string>
std::multimap<std::string, std::string>
get_all_service_mappings_2to1()
{
static std::map<std::string, std::string> mappings = {
static std::multimap<std::string, std::string> mappings = {
@[for s in services]@
{
"@(s['ros2_package'])/srv/@(s['ros2_name'])", // ROS 2
Expand Down