mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-09 06:17:46 +08:00
feat: support multiple ROS 2 distributions
This commit is contained in:
@@ -35,20 +35,20 @@ size_t image_rcl_publisher::get_subscription_count() const {
|
||||
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(
|
||||
#ifdef image_transport_NODE_INTERFACE
|
||||
image_publisher_impl =
|
||||
std::make_shared<image_transport::Publisher>(image_transport::create_publisher(
|
||||
#ifdef ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES
|
||||
image_transport::RequiredInterfaces{node},
|
||||
#else
|
||||
&node,
|
||||
#endif
|
||||
topic_name,
|
||||
#ifdef image_transport_QoS
|
||||
#ifdef ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES
|
||||
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);
|
||||
@@ -57,4 +57,4 @@ void image_transport_publisher::publish(sensor_msgs::msg::Image::UniquePtr image
|
||||
size_t image_transport_publisher::get_subscription_count() const {
|
||||
return image_publisher_impl->getNumSubscribers();
|
||||
}
|
||||
} // namespace orbbec_camera
|
||||
} // namespace orbbec_camera
|
||||
|
||||
Reference in New Issue
Block a user