YDLIDAR X2 DEVELOPMENT MANUAL Doc#:01.13.000101 https://www.facebook.com/ydlidar/ :01.13.
目录 WORKING MECHANISM................................................................................................................................. 2 Scan command...................................................................................................................................................2 Data protocol.......................................................................................................................................................3 Motor speed control.............
WORKING MECHANISM After the X2 is powered on, the system automatically starts the ranging. The following is the work-flow of the X2 system: System power on Start ranging Output data FIG 1 YDLIDAR X2 SYSTEM WORKFLOW SCAN COMMAND After power-on, the system will automatically start the ranging and output the message data for starting the scan to the serial port: A5 5A 05 00 00 40 81.
Type code:Start scan type code is 0x81; Response content:Scan data, see data protocol for details. DATA PROTOCOL After the system starts scanning, the scanned data is output in the subsequent messages. The data protocol is sent to the external device in hexadecimal to the serial port according to the following data structure.
Si is sampling data. Set the sampling data to E5 6F. Since this system is a little-endian mode, the sampling point S = 0x6FE5, substitute the formula to get Distance = 7161.25mm. Angle analysis: Angle data is stored in the FSA and LSA. Each angle data has the following data structure, C is a parity bit, and its value is fixed at 1. There are two levels of angle resolution: first level analysis and second level analysis.
Assume that in the frame data, Distance = 1000,Distance hhh,and bring in the second-level solution formula, you get: − d7 AngCorrect ⺂ ⺂ Similarly, ⺂ ⺂ ⺂ Check code: ° ,AngCorrect AngCorrect = AngCorrect h 7dh 7 ° = hrd h 7d h7 °, so: ° ,can be obtained sequentially. The check code uses a two-byte XOR to verify the current data packet, and does not participate in the exclusive OR operation itself, and the XOR sequence is not strictly in byte order. The XOR sequence is shown in the figure.
www.ydlidar.