|
10 | 10 | #include <rosidl_typesupport_introspection_cpp/identifier.hpp> |
11 | 11 | #include <fmt/core.h> |
12 | 12 |
|
| 13 | +#include "typesupport_wrapper.h" |
| 14 | + |
13 | 15 | bool TypeHasHeader(const rosidl_message_type_support_t* type_support) |
14 | 16 | { |
15 | 17 | auto members = static_cast<const rosidl_typesupport_introspection_cpp::MessageMembers*>(type_support->data); |
@@ -42,9 +44,9 @@ std::string CreateSchema(const std::string& base_type) |
42 | 44 |
|
43 | 45 | auto addTypeToSchema = [&](const std::string& type_name, bool add_header) |
44 | 46 | { |
45 | | - auto introspection_library = rclcpp::get_typesupport_library(type_name, "rosidl_typesupport_introspection_cpp"); |
46 | | - auto introspection_support = rclcpp::get_message_typesupport_handle( |
47 | | - type_name, "rosidl_typesupport_introspection_cpp", *introspection_library); |
| 47 | + auto introspection_library = wrapper::get_typesupport_library(type_name, "rosidl_typesupport_introspection_cpp"); |
| 48 | + auto introspection_support = wrapper::get_message_typesupport_handle( |
| 49 | + type_name, "rosidl_typesupport_introspection_cpp", introspection_library); |
48 | 50 |
|
49 | 51 | if (add_header) |
50 | 52 | { |
@@ -146,13 +148,13 @@ TopicInfo CreateTopicInfo(const std::string& topic_name, const std::string& type |
146 | 148 | info.topic_name = topic_name; |
147 | 149 | info.type = type_name; |
148 | 150 |
|
149 | | - info.introspection_library = rclcpp::get_typesupport_library(type_name, "rosidl_typesupport_introspection_cpp"); |
150 | | - info.introspection_support = rclcpp::get_message_typesupport_handle(type_name, "rosidl_typesupport_introspection_cpp", |
151 | | - *info.introspection_library); |
| 151 | + info.introspection_library = wrapper::get_typesupport_library(type_name, "rosidl_typesupport_introspection_cpp"); |
| 152 | + info.introspection_support = wrapper::get_message_typesupport_handle(type_name, "rosidl_typesupport_introspection_cpp", |
| 153 | + info.introspection_library); |
152 | 154 |
|
153 | 155 | auto identifier = rosidl_typesupport_cpp::typesupport_identifier; |
154 | | - info.support_library = rclcpp::get_typesupport_library(type_name, identifier); |
155 | | - info.type_support = rclcpp::get_message_typesupport_handle(type_name, identifier, *info.support_library); |
| 156 | + info.support_library = wrapper::get_typesupport_library(type_name, identifier); |
| 157 | + info.type_support = wrapper::get_message_typesupport_handle(type_name, identifier, info.support_library); |
156 | 158 |
|
157 | 159 | info.has_header_stamp = TypeHasHeader(info.introspection_support); |
158 | 160 | return info; |
|
0 commit comments