ros2 / rosidl_typesupport

Packages which provide the typesupport for ROS messages and services
Apache License 2.0
13 stars 34 forks source link

Add typesupport for actions in c and c++ #36

Closed apojomovsky closed 5 years ago

apojomovsky commented 5 years ago

This PR addresses the second part of https://github.com/ros2/rosidl/issues/303 and https://github.com/ros2/rosidl/issues/302 , which was coupled to the first one.

connects to ros2/rcl_interfaces#48

apojomovsky commented 5 years ago

CI with ros2/rosidl_typesupport#36, ros2/rosidl#312 and ros2/rcl_interfaces#48

hidmic commented 5 years ago

@sloretz @apojomovsky I can't seem to be able to compile ros2/rcl#319 locally with ros2/rosidl_typesupport#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.

sloretz commented 5 years ago

@hidmic The linking issue should be solved by https://github.com/ros2/rosidl/pull/312/commits/2467acf62fe967bf1688a3c5c95f6737833de3c6 which changes rosidl_generate_action_interfaces() from a function to a macro (thanks @dirk-thomas). The linking issue happened because _AMENT_EXPORT_LIBRARIES was being set in a different scope than ament_package() was being called in.

apojomovsky commented 5 years ago

Thanks a lot for the fixes @sloretz ! Just verified that the rcl_action tests from @hidmic 's branch are now able to build/run successfully with the latest changes :+1: