ros2 bridge missing some data between C++ node
Using the main branch to run ros2 pub/sub examples and some messages lost between C++ dora node with ros2 bridge style
One dora mode publish message and another dora node receive message, however from receiver node not all messages received.
This seems related to https://github.com/jhelovuo/ros2-client/issues/25. Messages send at the beginning might be lost because it takes a bit until ROS2 creates the connection. You can avoid this by choosing reliable QoS settings. In the linked issue, the following settings were recommened:
If you want to receive samples published before the match was made, use e.g. the following QoS:
let reliable_qos = ros2::QosPolicyBuilder::new() .history(policy::History::KeepLast { depth: 10 }) .reliability(policy::Reliability::Reliable { max_blocking_time: ros2::Duration::from_millis(100), }) .durability(policy::Durability::TransientLocal) .build();Important elements here are Reliable, TransientLocal, and some reasonable History depth.
and
You need to set reliability = Reliable at both Publisher and Subscriber.
Could you try this?