fix bidirectional bridge looping over the messages with fastdds - #79
Open
cyrilleberger wants to merge 1 commit into
Open
fix bidirectional bridge looping over the messages with fastdds#79cyrilleberger wants to merge 1 commit into
cyrilleberger wants to merge 1 commit into
Conversation
AdamGoertz
reviewed
May 6, 2024
| bool has_publisher_with_gid(const rmw_gid_t & _publisher_gid) | ||
| { | ||
| for (auto it = bridged_topics_.begin(); it != bridged_topics_.end(); ++it) { | ||
| if (*it->second.first->get_base_publisher() == _publisher_gid) { |
There was a problem hiding this comment.
Thanks for looking into this, we were having problems with this issue and this PR helped us. I noticed one issue when we tried using this; we got a segmentation fault on this line. I haven't looked into the root cause, but adding this patch fixed the issue.
Suggested change
| if (*it->second.first->get_base_publisher() == _publisher_gid) { | |
| if (it->second.first && *it->second.first->get_base_publisher() == _publisher_gid) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using fastdds (default in humble), and using a bidirectional topic bridge, the same message keep been sent over and over. This is because the behavior of
ignore_local_publicationsis different between fastdds and cyclonedds, this is was reported tormw_fastrtpsin ros2/rmw_fastrtps#573. To fix this problem, I made a change in domain_bridge to make sure that the message we receive from a subscriber do not come from a publisher owned by the bridge. This fix the problem of sending the same message over and over.