feat(perception_replayer): add a new perception_reproducer. #44
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.
Description
Add a new perception_reproducer_v2, that makes it possible to replay rosbag in chronological order even when ego is stopped. The algorithm follows this discussion.
How perception_reproducer_v2 works:
Generating reproduction_sequence: Whenever the ego's position changes, a chronological
reproduce_sequence
is generated or regenerated.A list of
nearby_ego_odom_indies
is found, which contains those odom massages close to the current ego pose within a search radius (default to 1 m), if the list is empty, the nearest odom massage in the rosebag is added to the list to make sure it's not empty.A larger list of
rosbag_ego_odom_indices
is found by searching those odom rosbag massages with a position close to the elements innearby_ego_odom_indies
within a radius (default 1 m).The list is sorted by timestamp, and those odom rosbag massages in the cooldown queue are filtered out.
set this list as the reproduce_sequence.
Publishing perception msg: The first element in the
reproduce_sequence
is popped and published. Published elements are added to a cooldown queue to prevent the same data from being republished in a short time during the ego's movement.reproduce_sequence
is popped and related perception messages are published.reproduce_sequence
is empty, the data that was published last time is published again.Why this design?:
reproduce_sequence
will update each time and the first element will be published, so it works as the originalperception_reproducer
.reproduce_sequence
will be published sequentially untilreproduce_sequence
is empty.Related links
https://tier4.atlassian.net/browse/RT1-6389
Tests performed
Screencast.from.2024.06.10.21.02.37.webm
Notes for reviewers
Note: this PR also contains two bugfix PR's modifications( fix(perception_replayer): order rosbags by starting_time, fix(perception_reproducer): Support reproduce/replay old rosbags. Before reviewing this, you may check and approve those two first.
Interface changes
Effects on system behavior
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.