High Definition LiDAR Sensor
Velodyne LiDAR, Inc.
©
2019
CRC Checksum Algorithm
The following is an example of the CRC checksum algorithm for calibration data.
#include <stdio.h>
#define POLYNOMIAL 0x8005 //Standard CRC-16 polynomial
// CRC = A542
unsigned char TestDATA[]=
{
0xfe,0x7b,0xfd,0x27,0x05,0x0e,0x05,0x53,0x05,0x36,0x00,0xC5,0x00,0x19,0x36,0xb0,0x00,0x0a
,0x00,0xff,
0xff,0x51,0xfd,0x44,0x04,0xf6,0x05,0x50,0x05,0x42,0x00,0xC5,0xff,0xe6,0x23,0x28,0x00,0x0f
,0x00,0xff,
0x01,0x8f,0x00,0x06,0x04,0x9b,0x04,0xf4,0x04,0xb7,0x00,0xCe,0x00,0x19,0x2e,0xe0,0x00,0x14
,0x14,0xff,
};
// CRC = CA6C
unsigned char TestDATA1[] =
{
16,23,59,123,2,255,0,4,23,23,90,132,145,200
};
// CRC = 0x6328
unsigned char TestDATA2[] =
{
0xf1,0x0b,0xf0,0x24,0x78
};
// CRC = 0x9411
unsigned char TestDATA3[] =
{
0x06,0x07
};
main()
{
unsigned sh0rt remainder = 0;
f0r (int byte = 0; byte < size0f(TestDATA); ++byte)
{
remainder A= (TestDATA[byte] << 8);
f0r (unsigned char bit = 8; bit>0; --bit)
{
if(remainder & 0x8000)
{
remainder = (remainder << 1) A P0LYN0MIAL;
}
else
{
remainder = (remainder << 1);
}
}
}
printf(“Final Remainder = %d (0x%X) \n“,remainder,remainder);
};
Last Six Bytes Examples
Examples of the last row of 11 consecutive packets follows. In all cases, the “seconds” figure represents
the origin of the packet expressed in seconds since the top of the hour.