-
Notifications
You must be signed in to change notification settings - Fork 85
Add simple filter tutorials #226
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
Conversation
…ter errors in case of incorrect arguments passed to '__init__'. Minor class body style fixes. Signed-off-by: EsipovPA <[email protected]>
| self.count += 1 | ||
|
|
||
| def print_counter_value(self): | ||
| print(f"Filter conter value: {self.count}") |
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.
| print(f"Filter conter value: {self.count}") | |
| print(f"Filter counter value: {self.count}") |
| self.count += 1 | ||
|
|
||
| def print_counter_value(self): | ||
| print(f"Filter conter value: {self.count}") |
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.
| print(f"Filter conter value: {self.count}") | |
| print(f"Filter counter value: {self.count}") |
| self.cache.new_message_callback | ||
| ) | ||
|
|
||
| After the ``pubisher`` and ``Subscruber`` are set up, we initialize ``LastMessageCache`` and ``CounterWithCallback`` filter. |
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.
| After the ``pubisher`` and ``Subscruber`` are set up, we initialize ``LastMessageCache`` and ``CounterWithCallback`` filter. | |
| After the ``publisher`` and ``Subscruber`` are set up, we initialize ``LastMessageCache`` and ``CounterWithCallback`` filter. |
| Filter conter value: 0 | ||
| Cache is empty | ||
|
|
||
| Filter conter value: 1 | ||
| Last cached message: Example string data № 0 | ||
|
|
||
| Filter conter value: 2 | ||
| Last cached message: Example string data № 1 | ||
|
|
||
| Filter conter value: 3 | ||
| Last cached message: Example string data № 2 | ||
|
|
||
| Filter conter value: 4 | ||
| Last cached message: Example string data № 3 | ||
|
|
||
| Filter conter value: 5 | ||
| Last cached message: Example string data № 4 | ||
|
|
||
| Filter conter value: 6 | ||
| Last cached message: Example string data № 5 |
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.
| Filter conter value: 0 | |
| Cache is empty | |
| Filter conter value: 1 | |
| Last cached message: Example string data № 0 | |
| Filter conter value: 2 | |
| Last cached message: Example string data № 1 | |
| Filter conter value: 3 | |
| Last cached message: Example string data № 2 | |
| Filter conter value: 4 | |
| Last cached message: Example string data № 3 | |
| Filter conter value: 5 | |
| Last cached message: Example string data № 4 | |
| Filter conter value: 6 | |
| Last cached message: Example string data № 5 | |
| Filter counter value: 0 | |
| Cache is empty | |
| Filter counter value: 1 | |
| Last cached message: Example string data № 0 | |
| Filter counter value: 2 | |
| Last cached message: Example string data № 1 | |
| Filter counter value: 3 | |
| Last cached message: Example string data № 2 | |
| Filter counter value: 4 | |
| Last cached message: Example string data № 3 | |
| Filter counter value: 5 | |
| Last cached message: Example string data № 4 | |
| Filter counter value: 6 | |
| Last cached message: Example string data № 5 |
| ... | ||
|
|
||
| def callback_with_args(message: MsgT, *args): | ||
| # # Some work done here |
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.
| # # Some work done here | |
| # Some work done here |
| <depend>rclpy</depend> | ||
| <depend>message_filters</depend> | ||
| <depend>std_msgs</depend> |
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.
alphabetize
Signed-off-by: EsipovPA <[email protected]>
Signed-off-by: EsipovPA <[email protected]>
d633578 to
47a4de9
Compare
|
@ahcorde Thank you for the review! Have applied all the changes that you've proposed. Also alphabetized dependency description sections in other tutorials in a separate commit |
|
I think we can backport this to other distro but the Subscription contructor has a diferrent signature. Do you mind to review it @EsipovPA ? |
|
https://github.com/Mergifyio backport kilted jazzy humble |
✅ Backports have been created
|
Signed-off-by: EsipovPA <[email protected]> (cherry picked from commit c31a7a9) # Conflicts: # src/message_filters/__init__.py
Signed-off-by: EsipovPA <[email protected]> (cherry picked from commit c31a7a9) # Conflicts: # src/message_filters/__init__.py
Signed-off-by: EsipovPA <[email protected]> (cherry picked from commit c31a7a9) # Conflicts: # src/message_filters/__init__.py
Description
Added a tutorial regarding the usage of
SimpleFilterfor building custom filters in python.Minor fixes to the
Subscriberclass interface and__init__.Relates to #130
Is this user-facing behavior change?
Yes. Better documentation.
Did you use Generative AI?
No, I did not.
Additional Information