Manual

www.ydlidar.com Copyright 2015-2018 Ydlidar Team
3 / 12
SYSTEM COMMUNICATION
Communication mechanism
G4 communicates commands and data with external devices through the serial port. When an
external device sends a system command to G4, G4 resolves the system command and returns a
corresponding reply message. According to the command content, G4 switches the corresponding
working status. According to the content of the message, the external system can parse the message
and obtain the response data.
FIG 2 YDLIDAR G4 SYSTEM COMMUNICATION
System command
The external system can set the corresponding working status of G4 and send corresponding data by
sending related system commands. The G4 system command is unified to 2 bytes, where the start
byte is 0xA5 and the second byte is the command content. The system commands issued by G4 are
as follows:
CHART 1 YDLIDAR G4 SYSTEM COMMAND
Description
Mode
Switching
Answer mode
0xA5
(Start)
0x60
Start scanning and export point cloud data
Scan mode
Sustained
response
0x65
Stop and stop scanning
Stop mode
No answer
0x90
Get device information (model, firmware, hardware
version)
-
Single
response
0x91
Get device status
-
Single
response
0x01
Low power consumption enabled. After the G4 is turned
on, the motor and ranging unit do not work in idle mode.
-
Single
response
0x02
After low power consumption is switched off, G4 still
operates in idle mode with the motor and distance
measuring unit.
-
Single
response
0x05
Get current motor and module status
-
Single
response
0x09
Increase the current scan frequency of 0.1Hz
-
Single
response
0x0A
Reduce the current scan frequency of 0.1Hz
-
Single
response
0x0B
Increase the current scan frequency of 1Hz
-
Single
response
0x0C
Reduce the current scan frequency of 1Hz
-
Single
response
0x0D
Get the currently set scan frequency
-
Single
response
0x0E
Turn on constant frequency function, constant motor speed
(default on)
-
Single
response
0x0F
Turn off the constant frequency function
-
Single
response
Parse messages
Retrieve data
Parsing command
External device
System command
Reply message
G4
Switch mode