Open sloretz opened 2 years ago
IIUC from @hidmic , the instrospection typesupport assumes the library is named the same as the package in more places than this.
A temporary workaround would be to warn in rosidl_generate_interfaces()
if the passed target name is anything other than ${PROJECT_NAME}
with a link to this issue.
@sloretz To add to this, I even added a macro quite recently to put together the library name given how often we do it elsewhere.
If we want to generalize library naming (and propagate them as a map? so downstream can fetch the right library for a given package), we have to make changes here and downstream. Otherwise, I agree that enforcing the name would be best.
Similar issue in the past https://github.com/ros2/rosidl_python/issues/11
I'm having the same issue but my case is a little different.
I am using msg from the same package. My exe is named by package name like this:
add_executable(${PROJECT_NAME} src/pcl_mapping.cpp)
then I generate the msg lib in the same cmake file, I have to change the lib name to another name (here by adding _msg
because the target name is already used by my exe (this is a cmake rule):
rosidl_generate_interfaces(${PROJECT_NAME}_msg
then this will lead to the exactly same error message as reported by this issue.
Bug report
Required Info:
Steps to reproduce issue
rosidl_generate_interfaces
fromtest_msgs
totest_msgs_interfaces
(ros2/rcl_interfaces#133)Expected behavior
All of rcl's tests would pass
Actual behavior
Many tests fail with
All failures:
Additional information
I don't fully understand what's going on, but I'm pretty sure this code is wrong. It assumes the library name for a typesupport target is going to be "__", but that's an incorrect assumption. The first part is the target name passed to
rosidl_generate_interfaces
, not the package name.https://github.com/ros2/rosidl_typesupport/blob/34f6e4b5296704c598037cb07299b12339afa8ab/rosidl_typesupport_c/src/type_support_dispatch.hpp#L57-L59