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

[ros2] Fix message duplication caused by bidirectional bridge (not for all rmw implementations) #146

Merged
merged 1 commit into from
Apr 5, 2021
Merged

[ros2] Fix message duplication caused by bidirectional bridge (not for all rmw implementations) #146

merged 1 commit into from
Apr 5, 2021

Conversation

AndrejOrsula
Copy link
Contributor

🦟 Bug fix

Fixes #143 (but not for all rmw implementations)

Summary

This PR adds ignore_local_publications option to ROS 2 subscriber of the bridge, which should fix duplication of Ignition messages (echoing). However, ROS 2 Design - Node to Participant mapping mentions that this feature is NOT part of all rmw implementations, and unfortunately, this feature is currently not implemented in the default FastRTPS rmw of ROS 2 Foxy. When using other rmw implementations like Cyclone DDS, the issue gets fixed by this PR, otherwise it persists.

I am aware that this way of fixing the issue is not robust enough, especially as it requires non-default configuration. If you know of a better solution to this problem, please close this PR. Else the documentation probably needs to be updated a bit.

To try out with FastRTPS (issue persists):

Shell 1:

ros2 run ros_ign_bridge parameter_bridge /chatter@std_msgs/msg/String@ignition.msgs.StringMsg

Shell 2:

ign topic -e -t /chatter

Shell 3:

ign topic -t /chatter -m ignition.msgs.StringMsg -p 'data:"This message should be received only once"'

To try out with Cyclone DDS (issue is fixed):

Install Cyclone DDS

sudo apt-get update && sudo apt-get install ros-${ROS_DISTRO}-rmw-cyclonedds-cpp

Shell 1:

export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ros2 run ros_ign_bridge parameter_bridge /chatter@std_msgs/msg/String@ignition.msgs.StringMsg

Shell 2:

ign topic -e -t /chatter

Shell 3:

ign topic -t /chatter -m ignition.msgs.StringMsg -p 'data:"This message should be received only once"'

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)

Note to maintainers: Remember to use Squash-Merge

- Note: Does not work with all rmw implementations (e.g.: FastRTPS)

Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Thanks! I think this is good to get in because it solves the problem for some RMWs. Here's an issue for support on FastRTPS: ros2/rmw_fastrtps#76

@chapulina chapulina merged commit 889de82 into gazebosim:ros2 Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ROS 2 ROS 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants