Skip to content

Commit

Permalink
Bugfix. Event publisher not starting for second run after stop
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Orlov <[email protected]>
  • Loading branch information
MichaelOrlov committed Dec 26, 2024
1 parent 0823be2 commit de9782f
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 de9782f

Please sign in to comment.