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
Action message support #417
Action message support #417
Changes from 20 commits
110d965
047c8f1
556a606
dfdcbd3
67c3b8b
b197155
13474d1
3e70087
17cd980
fb9b0e4
5f3373f
562132b
dc90b21
1ed2981
568bb7c
23e9c94
6d7021a
7a39794
c5bd258
2748b5f
507a7af
7d30fb1
3c1663f
0493705
8bedfe0
5dece63
db575ef
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.
This is a little confusing to me. Looking at (what I believe to be) the impl for this typesupport function (link)
Why are we actually returning a void pointer here? This function is not marked as unsafe, but any handling of the return value may well need to use unsafe code. Could we not return a well formed type, such as
rosidl_service_type_support_t
?This function seems to initialize the request and response members, but I don't actually see where those members are. The
@(type_name)
struct appears empty. How is this working?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.
c_void
. However, doing so hasn't been necessary yet, and this is following the same pattern as the existingget_type_support
functions for messages and services. To make this happen, we would have to create a Rust binding for therosidl_{message,service,action}_type_support_t
structs, probably inrosidl_runtime_rs
. I would be inclined to leave this for a separate PR to avoid growing the scope of this one.@(type_name)
struct is empty since it's not really meant to be instantiated. It would only be used as a genericimpl Action
argument and to access the specificGoal
,Feedback
, andResult
associated message types.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.
Sure, I'm fine leaving this to another PR. Just took a look at our usages (1) of this function historically and we do have
as
casts everywhere.as
casts can be problematic. So it would be nice to eventually not need this. However, maybe there is some other reason I'm missing as to why we returnvoid*
here.I was referring to the data that function actually mutates in its implementation. I was misunderstanding and assumed that we actually held a handle to that data, but apparently we do not. It is a global variable managed by I guess the rosidl_runtime(?) that will be generated for each service.
This is outside the scope of this PR though. Just calling attention to it because we've been bitten by global variables we directly interact with via FFI before, see #386
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.
as
casts. I think the only thing preventing that would be defining the appropriate binding type in therosidl_runtime_rs
package. I can make an attempt at that in a follow-up PR.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 thought we didn't want to have a dependency on
unique_identifier_msgs
hereThere 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.
We want to avoid creating a dependency on
unique_identifier_msgs
from therosidl_runtime_rs
package, since the latter is a dependency of all message packages. This would cause a cyclic dependency.However, the crates generated by the
rosidl_generator_rs
do have dependencies on any message packages they use as fields. In this case,unique_identifier_msgs/msg/UUID
is a field of the underlying goal service request type.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.
Ahh, I see. So the function signature of
create_goal_request
can't referenceunique_identifier_msgs
but the impl of that function actually can.Yeah, we should explore some of the ideas discussed earlier to simplify this. Not needed for this PR though.