ryan-brazeal-ufl / OpenPyLivox

Python3 driver for Livox lidar sensors
GNU General Public License v3.0
87 stars 44 forks source link

about the calculation of crc16 and crc32 #40

Closed hahakid closed 2 years ago

hahakid commented 2 years ago

in the beginning of openpylivox(object), CMD codes are first defined.

take _CMD_LIDAR_SINGLE_1ST for example, its hexcode is: AA011000000000B80901060001B5A043.

according to the Protocol, I sparate it into different fields as follow:

sof ver len cmd seq crc16 data crc32 b'AA 01 1000 00 0000 B809 010600 01B5A043'

The crc16 = B809 and crc32 = 01B5A043.

My question is what crc16 and crc32 schemes are used, or maybe I calculated in a wrong way, I cannot generate a right crc32 checksum. So I am not sure what is the right CMD for triple return mode: AA011000000000B809010603+crc32

010603: set=0x01, id=0x06, data=0x03

hahakid commented 2 years ago

https://github.com/Livox-SDK/Livox-SDK/tree/7cf759a760ac674b7032c48b46ef8aaadab90383/sdk_core/src/third_party/FastCRC