Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite TopicFilter for single-call reusability #924

Merged
merged 4 commits into from
Nov 30, 2021

Conversation

emersonknapp
Copy link
Collaborator

@emersonknapp emersonknapp commented Nov 29, 2021

Part of #831
Going to use this filter for Converter functionality to choose which Writers receive which topics from Readers. The single-call structure makes it clear that both the Recorder and the Converter use the same logic.

The current implementation was hard to understand the order of operations for the topic filter.

This new implementation fully checks each topic all the way through all filters, allowing it to be easily used for a single topic, or iterate over a container. This is a mild optimization in that only a single container copy is done, rather than repeatedly copying into a new container for each filter step.

More importantly, it makes the pipeline of functions easier to follow and extend by clearly showing the linear order of filters for a topic.

@emersonknapp emersonknapp requested a review from a team as a code owner November 29, 2021 20:26
@emersonknapp emersonknapp requested review from gbiggs and lihui815 and removed request for a team November 29, 2021 20:26
Copy link
Contributor

@lihui815 lihui815 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aprvd

@emersonknapp
Copy link
Collaborator Author

Gist: https://gist.githubusercontent.com/emersonknapp/381cd682c4996d49c6ebe6c2bff84f58/raw/78b1ff1c7c2c9037644aba6e82180650249d820b/ros2.repos
BUILD args: --packages-up-to rosbag2_transport rosbag2_tests rosbag2
TEST args: --packages-select rosbag2_transport rosbag2_tests rosbag2
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/9402

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@emersonknapp emersonknapp force-pushed the emersonknapp/topic-filter-single-call branch from c2c417e to 7c8568e Compare November 30, 2021 00:40
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp emersonknapp force-pushed the emersonknapp/topic-filter-single-call branch from 7c8568e to c9c2407 Compare November 30, 2021 00:47
@emersonknapp
Copy link
Collaborator Author

Gist: https://gist.githubusercontent.com/emersonknapp/bf422b73c5ded4e87b1dedca3c876f32/raw/78b1ff1c7c2c9037644aba6e82180650249d820b/ros2.repos
BUILD args: --packages-up-to rosbag2_transport rosbag2_tests rosbag2
TEST args: --packages-select rosbag2_transport rosbag2_tests rosbag2
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/9404

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@emersonknapp emersonknapp mentioned this pull request Nov 30, 2021
@emersonknapp
Copy link
Collaborator Author

Windows Build Status

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp
Copy link
Collaborator Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants