File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 20
20
#include < string>
21
21
22
22
#include < gz/transport/Node.hh>
23
+ #include < gz/transport/SubscribeOptions.hh>
23
24
24
25
// include ROS 2
25
26
#include < rclcpp/rclcpp.hpp>
@@ -105,17 +106,16 @@ class Factory : public FactoryInterface
105
106
size_t /* queue_size*/ ,
106
107
rclcpp::PublisherBase::SharedPtr ros_pub)
107
108
{
108
- std::function<void (const GZ_T &,
109
- const gz::transport::MessageInfo &)> subCb =
110
- [this , ros_pub](const GZ_T & _msg, const gz::transport::MessageInfo & _info)
109
+ std::function<void (const GZ_T &)> subCb =
110
+ [this , ros_pub](const GZ_T & _msg)
111
111
{
112
- // Ignore messages that are published from this bridge.
113
- if (!_info.IntraProcess ()) {
114
- this ->gz_callback (_msg, ros_pub);
115
- }
112
+ this ->gz_callback (_msg, ros_pub);
116
113
};
117
114
118
- node->Subscribe (topic_name, subCb);
115
+ // Ignore messages that are published from this bridge.
116
+ gz::transport::SubscribeOptions opts;
117
+ opts.SetIgnoreLocalMessages (true );
118
+ node->Subscribe (topic_name, subCb, opts);
119
119
}
120
120
121
121
protected:
You can’t perform that action at this time.
0 commit comments