-
Notifications
You must be signed in to change notification settings - Fork 37
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 typesupport for actions in c and c++ #36
Conversation
@@ -0,0 +1,36 @@ | |||
// Copyright 2016 Open Source Robotics Foundation, Inc. |
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.
2018
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.
Actually I don't think this file is necessary like it is for messages and services. The action type support doesn't change with rmw
implementation, so there's no need to have a dispatch.
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.
That's true, but don't we need it to get proper typesupport for the underlying services and messages? Nvm, wrong assumption.
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.
That's true, but don't we need it to get proper typesupport for the underlying services and messages?
Yes, but that can use the dispatch on the generated messages and services. The generated action type support just needs to call get_service_type_support<>()
or get_message_type_support<>()
, and in C ROSIDL_GET_SRV_TYPE_SUPPORT()
or ROSIDL_GET_MSG_TYPE_SUPPORT()
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.
Right, I realized shortly after I commented.
@@ -0,0 +1,124 @@ | |||
// generated from rosidl_typesupport_c/resource/action__type_support.cpp.em |
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.
Same as above comment I don't think this file is needed because no dispatch is needed for actions.
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.
True.
@@ -0,0 +1,34 @@ | |||
// Copyright 2016 Open Source Robotics Foundation, Inc. |
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.
Same as above comments, I don't think this file is needed.
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.
True.
{ | ||
|
||
template<> | ||
ROSIDL_GENERATOR_C_PUBLIC_@(spec.pkg_name) |
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.
It looks like this will need a different visibility macro ROSIDL_GENERATOR_C_PUBLIC_<package name>_ACTION
. This is needed to get the dllexport
and dllimport
correct when generating these files.
See changes in this diff.
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 point. Added.
6d4db14
to
c4b9758
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.
LGTM but for a few minor nits and pending CI.
@# Parsed specification of the .action file | ||
@# - subfolder (string) | ||
@# The subfolder / subnamespace of the message, usually 'action' | ||
@# - type_supports (list of strings) |
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.
@apojomovsky unused type_supports
list?
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.
true that, just removed references to it where unused. thanks!
args['output_dir'], subfolder, generated_filename % | ||
convert_camel_case_to_lower_case_underscore(spec.action_name)) | ||
|
||
data = {'spec': spec, 'subfolder': subfolder, 'type_supports': type_supports} |
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.
@apojomovsky same as above, are we using this type_supports
list?
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.
it's not being used, just removed it. thanks!
@# Parsed specification of the .action file | ||
@# - subfolder (string) | ||
@# The subfolder / subnamespace of the message, usually 'action' | ||
@# - type_supports (list of strings) |
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.
@apojomovsky unused type_supports
list?
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.
yup! removed, thanks!
@sloretz @apojomovsky I can't seem to be able to compile ros2/rcl#319 locally with #36, ros2/rosidl#312 and ros2/rcl_interfaces#48. --- stderr: rcl_action
CMakeFiles/test_action_client.dir/test/rcl_action/test_action_client.cpp.o: In function `TestActionClientBaseFixture_test_action_client_init_fini_Test::TestBody()':
test_action_client.cpp:(.text+0x50): undefined reference to `rosidl_typesupport_c__get_action_type_support_handle__test_msgs__action__Fibonacci'
CMakeFiles/test_action_client.dir/test/rcl_action/test_action_client.cpp.o: In function `TestActionClientFixture::SetUp()':
test_action_client.cpp:(.text._ZN23TestActionClientFixture5SetUpEv[_ZN23TestActionClientFixture5SetUpEv]+0x45): undefined reference to `rosidl_typesupport_c__get_action_type_support_handle__test_msgs__action__Fibonacci'
collect2: error: ld returned 1 exit status
make[2]: *** [test_action_client] Error 1
make[1]: *** [CMakeFiles/test_action_client.dir/all] Error 2
make: *** [all] Error 2
---
Failed <<< rcl_action [ Exited with code 2 ] However, the action interfaces library is generated and installed, and it does contain the missing symbol above, so it looks like there's a missing dependency relationship in the CMake infrastructure. I tried a fix but it isn't obvious to me where the chain broke. |
VERBATIM | ||
) | ||
|
||
set(_target_suffix "__generate_action_interfaces__rosidl_typesupport_cpp") |
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.
@apojomovsky @sloretz any reason for this to be reversed with respect to https://github.com/ros2/rosidl_typesupport/pull/36/files#diff-d9cdf0cebb0a07a690ecd5bcec505105R89 ?
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.
No reason
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.
Made consistent in 31efaca
@hidmic The linking issue should be solved by ros2/rosidl@2467acf which 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.
LGTM!
This PR addresses the second part of ros2/rosidl#303 and ros2/rosidl#302 , which was coupled to the first one.
rosidl_typesupport_c
androsidl_typesupport_cpp
to support the generation of typesupport headers for action files.connects to ros2/rcl_interfaces#48