VelodyneHDL icon indicating copy to clipboard operation
VelodyneHDL copied to clipboard

Can I use this code to get vlp-16 data on Linux system without ROS?

Open Zhang-Qinghui opened this issue 4 years ago • 2 comments

Hi,Thanks for your great work! Can I use this code to get vlp-16 data on Linux system without ROS?

Zhang-Qinghui avatar Jan 11 '21 04:01 Zhang-Qinghui

Hi, I'm wondering the same as @Zhang-Qinghui regarding the integration of the VLP-16 in your code. Reading through it, I noticed you needed to change the correction file in test_PacketDecoder.cpp on line 16 to "../16db.xml" for it to work correctly. However, I'm wondering if any other variables need to be changed in the other scripts ? For example in the header PacketDecoder.h you've defined const values for HDL_NUM_ROT_ANGLES, HDL_LASER_PER_FIRING, HDL_MAX_NUM_LASERS, HDL_FIRING_PER_PKT that are valid for the HDL-32E/64E lidars but maybe not for the VLP-16 ?

wsuter96 avatar Apr 08 '21 09:04 wsuter96

Alright, so I checked the VLP-16 Manual . It looks like the values set in the code for HDL_LASER_PER_FIRING, HDL_MAX_NUM_LASERS and HDL_FIRING_PER_PKT are all correct for the VLP-16 lidar as well. They are based on the data block definition (page 56, section 9.3.1.5 of VLP-16 user manual):

The information from two firing sequences (i.e. 2 x HDL_LASER_PER_FIRING = HDL_MAX_NUM_LASERS = 64) of 16 lasers is contained in each data block. Each packet contains the data from 24 firing sequences in 12 data blocks (i.e. HDL_FIRING_PER_PKT = 12). Only one Azimuth is returned per data block. A data block consists of 100 bytes of binary data:

  • A two-byte flag (0xFFEE)
  • A two-byte Azimuth
  • 32 Data Points (i.e. HDL_LASER_PER_FIRING = 32)

Additionally, the value set for HDL_NUM_ROT_ANGLES=36001 looks like it is also correct as (page 56, section 9.3.1.4 of VLP-16 user manual) "valid values for azimuth range from 0 to 35999" (i.e. HDL_NUM_ROT_ANGLES=36001). I believe HDL_NUM_ROT_ANGLES is used as a stopping criteria for the for loop of InitTables in PacketDecoder.cpp, thus the addition of +1 to the value.

This being said, I'm unsure about the flag 0xeeff used. It seems like for the VLP-16 you need to use the flag 0xffee. #1 Seems to address this issue, I'm wondering if this was every confirmed what had to be used ?

wsuter96 avatar Apr 08 '21 10:04 wsuter96