-
Notifications
You must be signed in to change notification settings - Fork 42
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
base: master
Are you sure you want to change the base?
added prefix verb and filter #39
Conversation
Hi @ruslanmustafin , thanks for your contribution. Before merging. Would you care adding a test? @AiVerisimilitude any remarks? |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove leftover code comments
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