-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add SubscriptionOptions wrapper #1074
base: rolling
Are you sure you want to change the base?
Conversation
289eaaf
to
a00babb
Compare
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.
@clintlombard thanks for the contribution.
So after all, this exposes sub_opts.ignore_local_publications
for rclpy, right?
Is there any related issue to address this feature? I think it would be nice to to support SubscriptionOptions
and PublisherOptions
.
@fujitatomoya I didn't find any applicable issues this was just based on a need I had for a tangential project. I could also look at adding |
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.
Just some minor comments, looks good to me !
Signed-off-by: Clint Lombard <[email protected]>
a00babb
to
19ce087
Compare
Thanks for catching those. All sorted |
class SubscriptionOptions(_rclpy.rmw_subscription_options_t): | ||
pass |
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.
I was expecting that abstraction class such as QoSProfile
with initialization, setter and getter accessors? so that it would be useful as python client library, and conceal implementation details with C/C++ language.
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.
I was trying to keep the implementation more in line with the rclcpp interface, but can look at the changes this might require.
@@ -100,7 +101,7 @@ class Subscription : public Destroyable, public std::enable_shared_from_this<Sub | |||
Node node_; | |||
std::shared_ptr<rcl_subscription_t> rcl_subscription_; | |||
}; | |||
/// Define a pybind11 wrapper for an rclpy::Service | |||
/// Define a pybind11 wrapper for an rclpy::Subscription |
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.
Good eye 👍
EmptyMsg, | ||
'test_topic', | ||
QoSProfile(depth=10).get_c_qos_profile(), | ||
None |
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.
I believe that we need to add more test cases here,
- actually use
SubscriptionOptions
as argument. (NotNone
case) - what is the default value for
SubscriptionOptions
? - verify
SubscriptionOptions
member variables set by user application?
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.
Good idea. I'll add a test case for this.
Expose
rmw_subscription_options
asSubscriptionOptions
.Example usage:
Output: