Fix publishing transient local topics before playing from start offset - #4
Draft
ajsampathk wants to merge 3 commits into
Draft
Fix publishing transient local topics before playing from start offset#4ajsampathk wants to merge 3 commits into
ajsampathk wants to merge 3 commits into
Conversation
Hugal31
reviewed
Apr 3, 2026
| // transient_local topic that was recorded before the start offset. | ||
| // This ensures latched data (e.g. /robot_description, static TFs) is | ||
| // available to subscribers even when playback starts partway through. | ||
| publish_transient_local_messages_before_start_offset(); |
There was a problem hiding this comment.
This potentially seek(begin), right after seek(starting_time_). Seek can be a costly operation, maybe reorder the seek() and the publish_transient_local_messages_before_start_offset?
Author
There was a problem hiding this comment.
This is a good point, I do readers_->seek(starting _time_) in the function so the previous seek is wasteful.
Thanks for the feedback. Will fix when I get a minute and try and propose this as a new feature upstream.
ajsampathk
marked this pull request as draft
April 29, 2026 15:18
…start_offset The function always seeks to earliest_time internally before scanning, so the seek(starting_time_) preceding it was wasted. Reorder so the function runs first and the single seek(starting_time_) follows, reducing three seeks to two in the transient-local path. https://claude.ai/code/session_01R4sSw7NnQSaDmgQQB3Z6ZD
Remove redundant seek in publish_transient_local_messages_before_start_offset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publish transient_local topics when using
--start-offsetWhen playing a bag with
--start-offset, topics with TRANSIENT_LOCAL durability (e.g./robot_description,/tf_stati,/map_amcl) are skipped because they are only published at the beginning of the bag.This change ensures the last message for each transient_local topic recorded before the start offset is published at the start of playback, so subscribers still receive essential latched data.
Tested on a couple bags from with
And it works fine.