Skip to content

Commit

Permalink
Reset clock publisher timer outisde playback loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaloi committed Nov 24, 2024
1 parent db4c90e commit 64bd7a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rosbag2_transport/src/rosbag2_transport/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,15 +488,19 @@ bool PlayerImpl::play()
std::chrono::nanoseconds delay_duration(delay.nanoseconds());
std::this_thread::sleep_for(delay_duration);
}
{
std::lock_guard<std::mutex> lk(reader_mutex_);
clock_->jump(starting_time_);
}
if (clock_publish_timer_ != nullptr) {
clock_publish_timer_->reset();
}
do {
{
std::lock_guard<std::mutex> lk(reader_mutex_);
reader_->seek(starting_time_);
clock_->jump(starting_time_);
}
if (clock_publish_timer_ != nullptr) {
clock_publish_timer_->reset();
}
load_storage_content_ = true;
storage_loading_future_ = std::async(
std::launch::async, [this]() {
Expand Down

0 comments on commit 64bd7a4

Please sign in to comment.