Skip to content

Commit

Permalink
checking origin of intra-process msg before taking them (#753)
Browse files Browse the repository at this point in the history
Signed-off-by: alberto <alberto.soragna@gmail.com>
Signed-off-by: Siddharth Kucheria <kucheria@usc.edu>
  • Loading branch information
alsora authored and skucheria committed Jul 13, 2019
1 parent 7950a5a commit 95e2418
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rclcpp/include/rclcpp/subscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ class Subscription : public SubscriptionBase
// However, this can only really happen if this node has it disabled, but the other doesn't.
return;
}

if (!matches_any_intra_process_publishers(&message_info.publisher_gid)) {
// This intra-process message has not been created by a publisher from this context.
// we should ignore this copy of the message.
return;
}

if (any_callback_.use_take_shared_method()) {
ConstMessageSharedPtr msg;
take_intra_process_message(
Expand Down

0 comments on commit 95e2418

Please sign in to comment.