Skip to content

Commit

Permalink
Merge pull request #2 from hsrn24/add-latching-to-the-current-traject…
Browse files Browse the repository at this point in the history
…ory-topic

added latching to the current_trajectory topic
  • Loading branch information
sdudiak-husarion authored Jan 10, 2024
2 parents 45dd0d1 + f83a518 commit 0cf4590
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/dynamic_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ void update_bridge(
ros2_publisher_qos.keep_all();
ros2_publisher_qos.transient_local();
}

/*
Adds latching to the current_trajectory topic
It prevents the situation where the topic is published on the ros1 side and the nodes on the ros2 side aren't initialized yet,
so the first message is not visible to them
*/
if (topic_name == "/robo_cart/cartographer_robo_cart_node/current_trajectory") {
ros2_publisher_qos.keep_all();
ros2_publisher_qos.transient_local();
}

try {
bridge.bridge_handles = ros1_bridge::create_bridge_from_1_to_2(
ros1_node, ros2_node,
Expand Down

0 comments on commit 0cf4590

Please sign in to comment.