-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fix up errors in doxygen documentation. #311
Conversation
While running the rosdoc2 tool against this repository, I came across these documentation errors. This PR fixes them all up so that doxygen runs clean. We still can't successfully run rosdoc2 on this package due to one other error, but at least this will get us ready once we figure that issue out. Signed-off-by: Chris Lalancette <[email protected]>
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 overall. I couldn't find \param[inout]
in the Doxygen commands manual, so I suggested the batch of changes.
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 don't feel strongly about [inout]
vs [in,out]
, but I think we use [inout]
elsewhere like in rclcpp.
rmw/include/rmw/types.h
Outdated
* | ||
* The definition of local is somewhat vague at the moment. | ||
* Right now it means local to the node, and that definition works best, but | ||
* may become more complicated when/if participants map to a context instead. |
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.
Is this correct to remove?
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 original thing that caused me to look at this was the \TODO
, which apparently doxygen doesn't understand as a tag.
That said, I believe that the situation now is different from what this comment says. We definitely did all of the one-participant-per-context stuff back in Foxy (and finished it in Galactic), so the comment is outdated. I didn't know what to replace it with, so I figured nothing was better than the wrong thing.
That said, if you have additional context, I'm happy to update this to something else. Maybe @ivanpauno can weigh in as well.
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.
Oh maybe it just needs to be \todo
, because that's definitely a thing:
https://www.doxygen.nl/manual/commands.html#cmdtodo
I agree it's out-of-date and needs to be updated, but just dropping the whole section without putting something new isn't right in my opinion. I could see dropping the the text but leaving the TODO...
Yeah, that's true. I was following that pattern here, though @aprotyas is correct about Doxygen suggesting |
@@ -2041,8 +2041,8 @@ rmw_send_request( | |||
* It will also be left unchanged if this function succeeds but `taken` is false. | |||
* | |||
* \param[in] client Service client to take response from. | |||
* \param[out] response_header Service response header to write to. | |||
* \param[out] ros_request Type erased ROS service response to write to. | |||
* \param[out] request_header Service response header to write to. |
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 think this should be response_header
(so the name in the signature needs to be updated). See the doc above and next to it.
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.
So I looked into this a bit. I think I agree with you on principle. However, all implementors (rmw_cyclonedds
, rmw_fastrtps_cpp
, rmw_connextdds
) call this request_header
, and all callers (rcl
) also call it request_header
. That may all be down to the fact that this API named it that, but I'd rather not confuse the situation and change it 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.
The request_header
is the one passed originally when the request was made, so it's indicating which request this response that you're taking goes with. So I think the name is right.
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
request_header
is the one passed originally when the request was made, so it's indicating which request this response that you're taking goes with.
I don't think that's right unfortunately. It tripped me up at first when implementing rmw_take_response
recently; I thought I could use the header's request ID/sequence number to get the corresponding response, but that's not it. By looking at the implementations, this header parameter is strictly an out
param, so rmw_take_response
takes any response and not a specific response for a specific request. That response is then matched with the original request elsewhere (like rclcpp
) using the request ID from the header.
The documentation here and in rcl
is kind of confusing/contradictory, which I why I commented when I saw this. request_header
should be changed to response_header
(because it's information about the response we are taking, and not the original request), but as @clalancette said, it's called request_header
pretty much everywhere.
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.
Sorry, I didn't mean to say the request_header
is an input for this take function, but that it is an output, as you said.
I see why you're confused, but I don't think that request_header
is wrong, because it really contains information about the originating request. This information is about the request, as in which request is associated with this response and as you said it is used later to associate the response with an original request by either the user or rclcpp
.
That being said, it does contain information about the response specifically, like the source and destination timestamps. So maybe the name should be response_header
or response_info
(I think info is a better term, to match rcl_take_with_info
for example, but that's not really important).
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.
And rmw_service_info_t
could more likely be named rmw_service_response_info_t
, but for all of this the question is if changing the names is worth the churn. I'd lean towards yes (clearer is always better, also helps us feel proud in knowing what we make/maintain makes sense), but also it could be disruptive and work.
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.
Yeah, renaming would make all of this confusion go away. If you think it's worth it, then I can probably do it at some point in the future. Otherwise, I'll just stop 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.
Changing the parameter name is not a big deal, but changing the type name for the struct is a larger change, though a valuable one I think.
I'm fine with changing the variable name, but we should do that in another pr, since this one is about fixing the documentation for what's already there. @clalancette thoughts?
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.
Yes, I'm fine with changing the variable name (this will have no material API/ABI impact, but will make things clearer).
If we do that, I think we should change the upstream and downstreams of this as well, so everything is consistent.
But all of that should be in a separate set of PRs.
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 opened an issue to track this: #312
Yeah, I don't mind about the inout thing. I would say just leave it inout for consistency. |
Signed-off-by: Chris Lalancette <[email protected]>
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.
lgtm
@@ -2041,8 +2041,8 @@ rmw_send_request( | |||
* It will also be left unchanged if this function succeeds but `taken` is false. | |||
* | |||
* \param[in] client Service client to take response from. | |||
* \param[out] response_header Service response header to write to. | |||
* \param[out] ros_request Type erased ROS service response to write to. | |||
* \param[out] request_header Service response header to write to. |
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 request_header
is the one passed originally when the request was made, so it's indicating which request this response that you're taking goes with. So I think the name is right.
I believe the conversation in #311 (comment) is wrapped up (with further work to come, but in a different PR). With that said, this now has approvals. It also has green PR job. I'm going to skip CI since this is a documentation change only. Thanks for the reviews! |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2021-08-19/22008/1 |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2021-9-16/22372/1 |
While running the rosdoc2 tool against this repository, I
came across these documentation errors. This PR fixes them
all up so that doxygen runs clean. We still can't successfully
run rosdoc2 on this package due to one other error, but at
least this will get us ready once we figure that issue out.
Signed-off-by: Chris Lalancette [email protected]