17#include <boost/algorithm/string/trim.hpp>
21 namespace std_ph = std::placeholders;
24 : carma_ros2_utils::CarmaLifecycleNode(options)
41 boost::algorithm::trim(type);
43 if (type ==
"geometry_msgs/Vector3Stamped")
44 return std::make_unique<Transformer<geometry_msgs::msg::Vector3Stamped>>(
config_,
buffer_, shared_from_this());
46 else if (type ==
"geometry_msgs/PointStamped")
47 return std::make_unique<Transformer<geometry_msgs::msg::PointStamped>>(
config_,
buffer_, shared_from_this());
49 else if (type ==
"geometry_msgs/PoseStamped")
50 return std::make_unique<Transformer<geometry_msgs::msg::PoseStamped>>(
config_,
buffer_, shared_from_this());
52 else if (type ==
"geometry_msgs/PoseWithCovarianceStamped")
53 return std::make_unique<Transformer<geometry_msgs::msg::PoseWithCovarianceStamped>>(
config_,
buffer_, shared_from_this());
55 else if (type ==
"geometry_msgs/QuaternionStamped")
56 return std::make_unique<Transformer<geometry_msgs::msg::QuaternionStamped>>(
config_,
buffer_, shared_from_this());
58 else if (type ==
"geometry_msgs/TransformStamped")
59 return std::make_unique<Transformer<geometry_msgs::msg::TransformStamped>>(
config_,
buffer_, shared_from_this());
61 else if (type ==
"sensor_msgs/PointCloud2")
62 return std::make_unique<Transformer<sensor_msgs::msg::PointCloud2>>(
config_,
buffer_, shared_from_this());
64 else if (type ==
"autoware_auto_msgs/BoundingBoxArray")
65 return std::make_unique<Transformer<autoware_auto_msgs::msg::BoundingBoxArray>>(
config_,
buffer_, shared_from_this());
67 else if (type ==
"autoware_auto_msgs/DetectedObjects")
68 return std::make_unique<Transformer<autoware_auto_msgs::msg::DetectedObjects>>(
config_,
buffer_, shared_from_this());
87 RCLCPP_INFO_STREAM(get_logger(),
"Loaded params: " <<
config_);
93 buffer_ = std::make_shared<tf2_ros::Buffer>(get_clock());
96 buffer_->setUsingDedicatedThread(
true);
105 RCLCPP_ERROR_STREAM(get_logger(),
"Failed to build transformer for specified message_type: " <<
config_.
message_type);
106 return CallbackReturn::FAILURE;
110 return CallbackReturn::SUCCESS;
119 return CallbackReturn::SUCCESS;
125#include "rclcpp_components/register_node_macro.hpp"