diff --git a/rosidl_typesupport_fastrtps_c/resource/msg__type_support_c.cpp.em b/rosidl_typesupport_fastrtps_c/resource/msg__type_support_c.cpp.em index bba3b13..8a67a28 100644 --- a/rosidl_typesupport_fastrtps_c/resource/msg__type_support_c.cpp.em +++ b/rosidl_typesupport_fastrtps_c/resource/msg__type_support_c.cpp.em @@ -1,7 +1,9 @@ @# Included from rosidl_typesupport_fastrtps_c/resource/idl__type_support_c.cpp.em @{ from rosidl_generator_c import idl_structure_type_to_c_typename -from rosidl_generator_type_description import TYPE_HASH_VAR +from rosidl_generator_type_description import GET_DESCRIPTION_FUNC +from rosidl_generator_type_description import GET_HASH_FUNC +from rosidl_generator_type_description import GET_SOURCES_FUNC from rosidl_parser.definition import AbstractGenericString from rosidl_parser.definition import AbstractNestedType from rosidl_parser.definition import AbstractSequence @@ -641,7 +643,9 @@ static rosidl_message_type_support_t _@(message.structure.namespaced_type.name)_ rosidl_typesupport_fastrtps_c__identifier, &__callbacks_@(message.structure.namespaced_type.name), get_message_typesupport_handle_function, - &@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(TYPE_HASH_VAR), + &@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_HASH_FUNC), + &@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_DESCRIPTION_FUNC), + &@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_SOURCES_FUNC), }; const rosidl_message_type_support_t * diff --git a/rosidl_typesupport_fastrtps_c/resource/srv__type_support_c.cpp.em b/rosidl_typesupport_fastrtps_c/resource/srv__type_support_c.cpp.em index ddb4e5d..0b75ea6 100644 --- a/rosidl_typesupport_fastrtps_c/resource/srv__type_support_c.cpp.em +++ b/rosidl_typesupport_fastrtps_c/resource/srv__type_support_c.cpp.em @@ -22,7 +22,9 @@ TEMPLATE( @{ from rosidl_generator_c import idl_structure_type_to_c_typename -from rosidl_generator_type_description import TYPE_HASH_VAR +from rosidl_generator_type_description import GET_DESCRIPTION_FUNC +from rosidl_generator_type_description import GET_HASH_FUNC +from rosidl_generator_type_description import GET_SOURCES_FUNC from rosidl_parser.definition import SERVICE_EVENT_MESSAGE_SUFFIX from rosidl_parser.definition import SERVICE_REQUEST_MESSAGE_SUFFIX from rosidl_parser.definition import SERVICE_RESPONSE_MESSAGE_SUFFIX @@ -78,7 +80,9 @@ static rosidl_service_type_support_t @(service.namespaced_type.name)__handle = { rosidl_typesupport_c, @(',\n '.join(service.namespaced_type.namespaced_name())) ), - &@(idl_structure_type_to_c_typename(service.namespaced_type))__@(TYPE_HASH_VAR), + &@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_HASH_FUNC), + &@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_DESCRIPTION_FUNC), + &@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_SOURCES_FUNC), }; const rosidl_service_type_support_t * diff --git a/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake b/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake index 46c2e2a..b93de4f 100644 --- a/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake +++ b/rosidl_typesupport_fastrtps_cpp/cmake/rosidl_typesupport_fastrtps_cpp_generate_interfaces.cmake @@ -157,6 +157,7 @@ endforeach() # Depend on the target created by rosidl_generator_cpp target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC + ${rosidl_generate_interfaces_TARGET}__rosidl_generator_c ${rosidl_generate_interfaces_TARGET}__rosidl_generator_cpp) # Make top level generation target depend on this library diff --git a/rosidl_typesupport_fastrtps_cpp/package.xml b/rosidl_typesupport_fastrtps_cpp/package.xml index 004b4cf..4cb2153 100644 --- a/rosidl_typesupport_fastrtps_cpp/package.xml +++ b/rosidl_typesupport_fastrtps_cpp/package.xml @@ -24,6 +24,7 @@ python3 + rosidl_generator_c rosidl_generator_cpp diff --git a/rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em b/rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em index a5cf502..022a1df 100644 --- a/rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em +++ b/rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em @@ -18,6 +18,7 @@ include_parts = [package_name] + list(interface_path.parents[0].parts) + [ include_base = '/'.join(include_parts) }@ #include "@(include_base)__rosidl_typesupport_fastrtps_cpp.hpp" +#include "@(include_base)__functions.h" #include "@(include_base)__struct.hpp" @{ diff --git a/rosidl_typesupport_fastrtps_cpp/resource/msg__type_support.cpp.em b/rosidl_typesupport_fastrtps_cpp/resource/msg__type_support.cpp.em index 110a321..d41759f 100644 --- a/rosidl_typesupport_fastrtps_cpp/resource/msg__type_support.cpp.em +++ b/rosidl_typesupport_fastrtps_cpp/resource/msg__type_support.cpp.em @@ -1,7 +1,9 @@ @# Included from rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em @{ from rosidl_generator_c import idl_structure_type_to_c_typename -from rosidl_generator_type_description import TYPE_HASH_VAR +from rosidl_generator_type_description import GET_DESCRIPTION_FUNC +from rosidl_generator_type_description import GET_HASH_FUNC +from rosidl_generator_type_description import GET_SOURCES_FUNC from rosidl_parser.definition import AbstractGenericString from rosidl_parser.definition import AbstractNestedType from rosidl_parser.definition import AbstractSequence @@ -507,7 +509,9 @@ static rosidl_message_type_support_t _@(message.structure.namespaced_type.name)_ rosidl_typesupport_fastrtps_cpp::typesupport_identifier, &_@(message.structure.namespaced_type.name)__callbacks, get_message_typesupport_handle_function, - &@('::'.join(message.structure.namespaced_type.namespaced_name()))::@(TYPE_HASH_VAR), + &@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_HASH_FUNC), + &@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_DESCRIPTION_FUNC), + &@(idl_structure_type_to_c_typename(message.structure.namespaced_type))__@(GET_SOURCES_FUNC), }; } // namespace typesupport_fastrtps_cpp diff --git a/rosidl_typesupport_fastrtps_cpp/resource/srv__type_support.cpp.em b/rosidl_typesupport_fastrtps_cpp/resource/srv__type_support.cpp.em index 2495ed8..250e7a3 100644 --- a/rosidl_typesupport_fastrtps_cpp/resource/srv__type_support.cpp.em +++ b/rosidl_typesupport_fastrtps_cpp/resource/srv__type_support.cpp.em @@ -1,6 +1,9 @@ @# Included from rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em @{ -from rosidl_generator_type_description import TYPE_HASH_VAR +from rosidl_generator_c import idl_structure_type_to_c_typename +from rosidl_generator_type_description import GET_DESCRIPTION_FUNC +from rosidl_generator_type_description import GET_HASH_FUNC +from rosidl_generator_type_description import GET_SOURCES_FUNC from rosidl_parser.definition import SERVICE_EVENT_MESSAGE_SUFFIX from rosidl_parser.definition import SERVICE_REQUEST_MESSAGE_SUFFIX from rosidl_parser.definition import SERVICE_RESPONSE_MESSAGE_SUFFIX @@ -79,7 +82,9 @@ static const rosidl_service_type_support_t _@(service.namespaced_type.name)__han ::rosidl_typesupport_fastrtps_cpp::get_message_type_support_handle<@('::'.join([package_name, *interface_path.parents[0].parts, service.namespaced_type.name]))@(SERVICE_EVENT_MESSAGE_SUFFIX)>(), &::rosidl_typesupport_cpp::service_create_event_message<@('::'.join([package_name, *interface_path.parents[0].parts, service.namespaced_type.name]))>, &::rosidl_typesupport_cpp::service_destroy_event_message<@('::'.join([package_name, *interface_path.parents[0].parts, service.namespaced_type.name]))>, - &@('::'.join(service.namespaced_type.namespaced_name()))::@(TYPE_HASH_VAR), + &@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_HASH_FUNC), + &@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_DESCRIPTION_FUNC), + &@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_SOURCES_FUNC), }; #ifdef __cplusplus