Skip to content

Commit

Permalink
Bugfix. Event publisher not starting for second run after stop (#1888)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit ffd8c7d)
  • Loading branch information
MichaelOrlov authored and mergify[bot] committed Dec 30, 2024
1 parent 02f7b89 commit 2af06d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rosbag2_transport/src/rosbag2_transport/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@ void RecorderImpl::record()
node->create_publisher<rosbag2_interfaces::msg::WriteSplitEvent>("events/write_split", 1);

// Start the thread that will publish events
event_publisher_thread_ = std::thread(&RecorderImpl::event_publisher_thread_main, this);
{
std::lock_guard<std::mutex> lock(event_publisher_thread_mutex_);
event_publisher_thread_should_exit_ = false;
event_publisher_thread_ = std::thread(&RecorderImpl::event_publisher_thread_main, this);
}

rosbag2_cpp::bag_events::WriterEventCallbacks callbacks;
callbacks.write_split_callback =
Expand Down

0 comments on commit 2af06d5

Please sign in to comment.