Skip to content

Commit 753a173

Browse files
authored
fix(planning_debug_tools): migrate to rclcpp typesupport helpers (#403)
Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
1 parent a2a7bea commit 753a173

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

planning/planning_debug_tools/src/perception_replayer/perception_replayer_common.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#include "serialized_bag_message.hpp"
1818
#include "utils.hpp"
1919

20+
#include <rclcpp/typesupport_helpers.hpp>
2021
#include <rosbag2_cpp/reader.hpp>
2122
#include <rosbag2_cpp/readers/sequential_reader.hpp>
22-
#include <rosbag2_cpp/typesupport_helpers.hpp>
2323
#include <rosbag2_storage/storage_filter.hpp>
2424
#include <rosbag2_storage/storage_options.hpp>
2525

@@ -79,12 +79,16 @@ void PerceptionReplayerCommon::load_rosbag(
7979
// try to load type support for each topic
8080
for (const auto & topic_meta : topics) {
8181
try {
82-
auto library =
83-
rosbag2_cpp::get_typesupport_library(topic_meta.type, "rosidl_typesupport_cpp");
82+
auto library = rclcpp::get_typesupport_library(topic_meta.type, "rosidl_typesupport_cpp");
8483
type_support_libs[topic_meta.name] = library;
8584

85+
#ifdef ROS_DISTRO_HUMBLE
8686
const rosidl_message_type_support_t * type_support =
87-
rosbag2_cpp::get_typesupport_handle(topic_meta.type, "rosidl_typesupport_cpp", library);
87+
rclcpp::get_typesupport_handle(topic_meta.type, "rosidl_typesupport_cpp", *library);
88+
#else
89+
const rosidl_message_type_support_t * type_support =
90+
rclcpp::get_message_typesupport_handle(topic_meta.type, "rosidl_typesupport_cpp", *library);
91+
#endif
8892

8993
if (type_support) {
9094
type_support_map[topic_meta.name] = std::shared_ptr<const rosidl_message_type_support_t>(

0 commit comments

Comments
 (0)