diff --git a/orbbec_camera/launch/lidar.launch.py b/orbbec_camera/launch/lidar.launch.py index 103ecb6b..b855544a 100644 --- a/orbbec_camera/launch/lidar.launch.py +++ b/orbbec_camera/launch/lidar.launch.py @@ -109,12 +109,12 @@ def generate_launch_description(): DeclareLaunchArgument( 'repetitive_scan_mode', default_value='-1', - description='Repetitive scan mode. -1 uses device default; other values depend on device capability.' + description='Repetitive scan mode. -1 uses device default; 0 non-repeating; 1/2/4 for different repetition frequencies.' ), DeclareLaunchArgument( 'filter_level', default_value='-1', - description='Filtering level. -1 uses default; non-negative integers increase filtering strength.' + description='Filtering level. -1 uses default; non-negative integers increase filtering strength, 0-5 are valid levels.' ), DeclareLaunchArgument( 'vertical_fov', diff --git a/orbbec_camera/src/ob_lidar_node.cpp b/orbbec_camera/src/ob_lidar_node.cpp index 7257a7d5..d76add59 100644 --- a/orbbec_camera/src/ob_lidar_node.cpp +++ b/orbbec_camera/src/ob_lidar_node.cpp @@ -635,6 +635,15 @@ void OBLidarNode::onNewFrameSetCallback(std::shared_ptr frame_set) // Handle multi-frame publishing for LIDAR_POINT and LIDAR_SPHERE_POINT formats if ((format_[LIDAR] == OB_FORMAT_LIDAR_POINT || format_[LIDAR] == OB_FORMAT_LIDAR_SPHERE_POINT)) { + if (publish_n_pkts_ == 1) { + if (format_[LIDAR] == OB_FORMAT_LIDAR_POINT) { + publishPointCloud(frame_set); + return; + } else if (format_[LIDAR] == OB_FORMAT_LIDAR_SPHERE_POINT) { + publishSpherePointCloud(frame_set); + return; + } + } std::lock_guard lock(frame_buffer_mutex_); frame_buffer_.push_back(frame_set); // If we have enough frames, publish merged point cloud @@ -1208,13 +1217,14 @@ void OBLidarNode::calcAndPublishStaticTransform() { // } // publishStaticTF(timestamp, zero_trans, quaternion_optical, frame_id_[stream_index], // optical_frame_id_[stream_index]); - // RCLCPP_INFO_STREAM(logger_, "Publishing static transform from " << stream_name_[stream_index] + // RCLCPP_INFO_STREAM(logger_, "Publishing static transform from " << + // stream_name_[stream_index] // << " to " // << // stream_name_[base_stream_]); // RCLCPP_INFO_STREAM(logger_, "Translation " << trans[0] << ", " << trans[1] << ", " << - // trans[2]); RCLCPP_INFO_STREAM(logger_, "Rotation " << Q.getX() << ", " << Q.getY() << ", " << - // Q.getZ() + // trans[2]); RCLCPP_INFO_STREAM(logger_, "Rotation " << Q.getX() << ", " << Q.getY() << ", " + // << Q.getZ() // << ", " << Q.getW()); // } if (enable_imu_) {