SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
89 stars 81 forks source link

confused when use sick_scan_xd api with picoscan #331

Closed Ts-sound closed 1 month ago

Ts-sound commented 1 month ago

env : ubuntu18 version : sick_scan_xd-3.2.0

I use api func SickScanApiRegisterCartesianPointCloudMsg to register my callback func , in my callback func , i printf some data like this:

void RadarSicksdk::customizedPointCloudMsgCb(SickScanApiHandle apiHandle,
                                             const SickScanPointCloudMsg* msg) {
  std::lock_guard<std::recursive_mutex> lck(radar_sicksdk->rmtx);

  log_debug(radar_sicksdk->logout_,
            "seg_idx=%d,height=%lu , width = %lu, point_step = %lu , "
            "msg->row_step = %lu "
            ", msg->is_dense= %lu ",
            msg->segment_idx, msg->height, msg->width, msg->point_step,
            msg->row_step, msg->is_dense);

        ...

when i run my program , i get :

sickscan

I'm confused about why the size of feedback segment points varies, and what causes this.

rostest commented 1 month ago

Thanks for your feedback. picoScan and multiScan lidars provide segmented scan data, where each segment covers a portion of the full 360-degree scan. The API callback function registered with SickScanApiRegisterCartesianPointCloudMsg receives both segmented and full frame point clouds in different sizes.

The segment index is provided in msg->segment_idx. It is either a value >= 0 for a single segment, or -1 for a full frame point cloud. The full frame point cloud is just the concatenation of all segments covering a full 360-degree scan. If you want to process the full point cloud, you can use the one with msg->segment_idx < 0 and ignore all other segment point clouds. See https://github.com/SICKAG/sick_scan_xd/blob/develop/doc/sick_scan_segment_xd.md for more information.

Ts-sound commented 1 month ago

thanks!