RoboSense-LiDAR / rslidar_sdk

RoboSense LiDAR SDK for ROS & ROS2
Other
473 stars 224 forks source link

RS BPearl publishes more points than it is supposed to #22

Open Patrick-Lascombe opened 3 years ago

Patrick-Lascombe commented 3 years ago

Hello, I'm working with a RS Bpearl 3d lidar at 10 Hz, so it should publish 57600 per sensor_msgs::PointCloud2 message. But around every second I receive a message with 57984 points. I looked the data sent by the lidar through wireshark and I found the same thing : from time to time there is an extra packet of data.

Is this normal ? And if so what is the use of this extra packet ?

Below is a few headers from the sensor_msgs::PointCloud2 message where the extras points appears

header: 
  seq: 10895
  stamp: 
    secs: 1610721842
    nsecs: 488307476
  frame_id: "rslidar_optical_center"
height: 32
width: 1800
fields: "<array type: sensor_msgs/PointField, length: 6>"
is_bigendian: False
point_step: 32
row_step: 57600
data: "<array type: uint8, length: 1843200>"
is_dense: False
---
header: 
  seq: 10896
  stamp: 
    secs: 1610721842
    nsecs: 588924408
  frame_id: "rslidar_optical_center"
height: 32
width: 1812
fields: "<array type: sensor_msgs/PointField, length: 6>"
is_bigendian: False
point_step: 32
row_step: 57984
data: "<array type: uint8, length: 1855488>"
is_dense: False
---
header: 
  seq: 10897
  stamp: 
    secs: 1610721842
    nsecs: 688874483
  frame_id: "rslidar_optical_center"
height: 32
width: 1800
fields: "<array type: sensor_msgs/PointField, length: 6>"
is_bigendian: False
point_step: 32
row_step: 57600
data: "<array type: uint8, length: 1843200>"
is_dense: False
---
HaoQChen commented 3 years ago

Hi, the motor speed is not that accurate, and network has delay. So point is not that steady.

You can set split frame mode to fixed number of package

lidar:
  - driver:
      lidar_type: RS128            #LiDAR type - RS16, RS32, RSBP, RS128, RS80, RSM1, RSHELIOS
      frame_id: /rslidar           #Frame id of message
      msop_port: 6699              #Msop port of lidar
      difop_port: 7788             #Difop port of lidar
      start_angle: 0               #Start angle of point cloud
      end_angle: 360               #End angle of point cloud 
      min_distance: 0.2            #Minimum distance of point cloud
      max_distance: 200            #Maximum distance of point cloud
      use_lidar_clock: false       #True--Use the lidar clock as the message timestamp
                                   #False-- Use the system clock as the timestamp  
     split_frame_mode:2