mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-07 05:27:45 +08:00
updata libOrbbecSDK.so , ob_camera_node and CMakeLists.txt
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
// Copyright 2023 Intel Corporation. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "orbbec_camera/image_publisher.h"
|
||||
|
||||
namespace orbbec_camera {
|
||||
|
||||
// --- image_rcl_publisher implementation ---
|
||||
image_rcl_publisher::image_rcl_publisher(rclcpp::Node& node, const std::string& topic_name,
|
||||
const rmw_qos_profile_t& qos) {
|
||||
image_publisher_impl = node.create_publisher<sensor_msgs::msg::Image>(
|
||||
topic_name, rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(qos), qos));
|
||||
}
|
||||
|
||||
void image_rcl_publisher::publish(sensor_msgs::msg::Image::UniquePtr image_ptr) {
|
||||
image_publisher_impl->publish(std::move(image_ptr));
|
||||
}
|
||||
|
||||
size_t image_rcl_publisher::get_subscription_count() const {
|
||||
return image_publisher_impl->get_subscription_count();
|
||||
}
|
||||
|
||||
// --- image_transport_publisher implementation ---
|
||||
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));
|
||||
}
|
||||
void image_transport_publisher::publish(sensor_msgs::msg::Image::UniquePtr image_ptr) {
|
||||
image_publisher_impl->publish(*image_ptr);
|
||||
}
|
||||
|
||||
size_t image_transport_publisher::get_subscription_count() const {
|
||||
return image_publisher_impl->getNumSubscribers();
|
||||
}
|
||||
} // namespace orbbec_camera
|
||||
Reference in New Issue
Block a user