mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-07 21:37:46 +08:00
Add zero copy
This commit is contained in:
@@ -1248,17 +1248,18 @@ void OBCameraNode::setupPublishers() {
|
|||||||
}
|
}
|
||||||
std::string name = stream_name_[stream_index];
|
std::string name = stream_name_[stream_index];
|
||||||
std::string topic = name + "/image_raw";
|
std::string topic = name + "/image_raw";
|
||||||
auto image_qos_profile = image_qos_[stream_index];
|
auto image_qos = image_qos_[stream_index];
|
||||||
// if (use_intra_process_) {
|
auto image_qos_profile = getRMWQosProfileFromString(image_qos);
|
||||||
// image_qos_profile = rmw_qos_profile_default;
|
if (use_intra_process_) {
|
||||||
// }
|
image_qos_profile = rmw_qos_profile_default;
|
||||||
// if (use_intra_process_) {
|
}
|
||||||
// image_publishers_[stream_index] =
|
if (use_intra_process_) {
|
||||||
// std::make_shared<image_rcl_publisher>(*node_, topic, image_qos_profile);
|
image_publishers_[stream_index] =
|
||||||
// } else {
|
std::make_shared<image_rcl_publisher>(*node_, topic, image_qos_profile);
|
||||||
// image_publishers_[stream_index] =
|
} else {
|
||||||
// std::make_shared<image_transport_publisher>(*node_, topic, image_qos_profile);
|
image_publishers_[stream_index] =
|
||||||
// }
|
std::make_shared<image_transport_publisher>(*node_, topic, image_qos_profile);
|
||||||
|
}
|
||||||
|
|
||||||
topic = name + "/camera_info";
|
topic = name + "/camera_info";
|
||||||
auto camera_info_qos = camera_info_qos_[stream_index];
|
auto camera_info_qos = camera_info_qos_[stream_index];
|
||||||
@@ -1276,15 +1277,15 @@ void OBCameraNode::setupPublishers() {
|
|||||||
rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(camera_info_qos_profile),
|
rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(camera_info_qos_profile),
|
||||||
camera_info_qos_profile));
|
camera_info_qos_profile));
|
||||||
}
|
}
|
||||||
// if (stream_index == COLOR && enable_color_undistortion_) {
|
if (stream_index == COLOR && enable_color_undistortion_) {
|
||||||
// if (use_intra_process_) {
|
if (use_intra_process_) {
|
||||||
// color_undistortion_publisher_ = std::make_shared<image_rcl_publisher>(
|
color_undistortion_publisher_ = std::make_shared<image_rcl_publisher>(
|
||||||
// *node_, "color/image_undistorted", image_qos_profile);
|
*node_, "color/image_undistorted", image_qos_profile);
|
||||||
// } else {
|
} else {
|
||||||
// color_undistortion_publisher_ = std::make_shared<image_transport_publisher>(
|
color_undistortion_publisher_ = std::make_shared<image_transport_publisher>(
|
||||||
// *node_, "color/image_undistorted", image_qos_profile);
|
*node_, "color/image_undistorted", image_qos_profile);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable_sync_output_accel_gyro_) {
|
if (enable_sync_output_accel_gyro_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user