Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 function to get publisher actual qos settings #406
Add function to get publisher actual qos settings #406
Changes from 3 commits
bf4296c
0f34fb7
9551395
cbd46cb
6695ead
2d7bb57
c91a27b
8c2cae2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm not sure whether or not you need to do this, but you may need to use
rcl_publisher_is_valid_except_context
here instead, depending on how/where we use this function in rclcpp. Basically right now, this function will fail afterrclcpp::shutdown()
/rcl_shutdown()
is called (or if SIGINT is received).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.
Maybe the right thing to do is to leave it as-is and explicitly handle/suppress this issue, e.g.:
https://github.com/ros2/rclcpp/blob/b352d450319e84dd28aed78b800ab40938cec5c2/rclcpp/include/rclcpp/publisher.hpp#L350-L353
Since this is just an accessor (should be possible to calculate this during init) then it is maybe ok to access it during post-shutdown?
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.
What I can do, is to call rcl_publisher_get_actual_qos in rcl_publisher_init, after creating the rmw publisher. Then, it's possible to store the corrected rcl_options, which could be accessed in post-shutdown.
rcl/rcl/src/rcl/publisher.c
Lines 167 to 175 in 03dec21
In that case, the method in rclcpp should be get_options, and get_actual_qos is unnecessary.
If not, the other option is to handle the error in rclcpp.
Any thoughts about which path take?
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.
The
get_options
, should (in my opinion) return the original options used. I could be convinced otherwise, but for now, that's what I think.So in that light I'd say we still need
get_actual_qos
.Why can't you just calculate the actual qos and store it separately (redundantly) during init?
Handling the error in rclcpp is possible, but only if it allows us to fail gracefully (not to be confused with silently). For instance, if we need to get the actual qos in order to decide the behavior of the publish function, you have to ask yourself what we'll do it it is unavailable, and if that mitigating action is ok.
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.
Sounds good to me, I will add that.