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

added prefix verb and filter #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ruslanmustafin
Copy link

Prefix allows to add a fixed pre-defined prefix to all topics inside a bag. Could be useful in case there are two bag files with identical topic names that need to be merged with ros2 bag convert

@devrite
Copy link
Contributor

devrite commented Mar 7, 2025

Hi @ruslanmustafin ,

thanks for your contribution. Before merging. Would you care adding a test?

@AiVerisimilitude any remarks?

Copy link

@AiVerisimilitude AiVerisimilitude left a comment

Choose a reason for hiding this comment

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

Looks good, the test should be straightforward but quite valuable, so it would be nice to have it as well

Thanks for your contribution!

def filter_msg(self, msg):
(topic, data, t) = msg

return (self._add_prefix(topic), data, t)

Choose a reason for hiding this comment

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

Add missing newline here

return f"{self._prefix}{topic_name}"

def filter_topic(self, topic_metadata):
# if topic_metadata.name == self._topic:

Choose a reason for hiding this comment

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

Remove leftover code comments


def add_arguments(self, parser):
parser.add_argument('-p', '--prefix', help='prefix to add')
# parser.add_argument('--name', required=True, help='new name to set')

Choose a reason for hiding this comment

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

Remove leftover code comments

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.

3 participants