mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 19:20:20 +08:00
update 'create_publisher' API
This commit is contained in:
@@ -57,6 +57,14 @@ if(message_filters_VERSION VERSION_GREATER_EQUAL 5.0)
|
||||
add_compile_definitions(message_filters_QoS)
|
||||
endif()
|
||||
|
||||
if(image_transport_VERSION VERSION_GREATER_EQUAL 6.4)
|
||||
add_compile_definitions(image_transport_NODE_INTERFACE)
|
||||
endif()
|
||||
|
||||
if(image_transport_VERSION VERSION_GREATER_EQUAL 6.4)
|
||||
add_compile_definitions(image_transport_QoS)
|
||||
endif()
|
||||
|
||||
if(USE_RK_HW_DECODER)
|
||||
pkg_search_module(RK_MPP REQUIRED rockchip_mpp)
|
||||
if(NOT RK_MPP_FOUND)
|
||||
|
||||
@@ -36,7 +36,19 @@ image_transport_publisher::image_transport_publisher(rclcpp::Node& node,
|
||||
const std::string& topic_name,
|
||||
const rmw_qos_profile_t& qos) {
|
||||
image_publisher_impl = std::make_shared<image_transport::Publisher>(
|
||||
image_transport::create_publisher(&node, topic_name, qos));
|
||||
image_transport::create_publisher(
|
||||
#ifdef image_transport_NODE_INTERFACE
|
||||
image_transport::RequiredInterfaces{node},
|
||||
#else
|
||||
&node,
|
||||
#endif
|
||||
topic_name,
|
||||
#ifdef image_transport_QoS
|
||||
rclcpp::QoS{rclcpp::QoSInitialization::from_rmw(qos), qos}
|
||||
#else
|
||||
qos
|
||||
#endif
|
||||
));
|
||||
}
|
||||
void image_transport_publisher::publish(sensor_msgs::msg::Image::UniquePtr image_ptr) {
|
||||
image_publisher_impl->publish(*image_ptr);
|
||||
|
||||
Reference in New Issue
Block a user