Manual

14 / 18
Copyright (c) 2009-2013 RoboPeak Team
Copyright (c) 2013-2016 Shanghai Slamtec Co., Ltd.
Figure 3-2 RPLIDAR Functions related to Measurement Scan Operation
The startScan() function will start a background worker thread to receive the
measurement scan data sequence sent from RPLIDAR asynchronously. The
received data sequence is stored in the drivers internal cache for the
grabScanData() function to fetch.
User programs can use the grabScanData() function to retrieve the scan data
sequence previously received and cached by the driver. This function always
returns a latest and complete 360-degrees measurement scan data sequence.
After each grabScanData() call, the internal data cache will be cleared to ensure
the grabScanData() wont get duplicated data.
In case a complete 360-degrees scan sequence hasnt been available at the
time when grabScanData() is called, the function will wait until a complete scan
data is received by the driver or the given timeout duration is expired. User
programs can tune this timeout value to meet different application requirements.
Note: the startScan() and stop() functions dont control the scanning motor
of the RPLIDAR directly. The host system should control the scanning motor to
rotate or stop via the PWM pin.
Function Name
Brief description
startScan()
Request the RPLIDAR core to start measurement scan operation
and send out result data continuously
If the Express Scan mode is supported, and the program invokes
the startScan() by using the default parameters
startScanNormal()
Force the RPLIDAR core to start measurement scan operation in
Scan mode
startScanExpress()
Force the RPLIDAR core to start measurement scan operation in
Express Scan mode. It the RPLIDAR firmware not supports Express
Scan mode, the function will fail the execution.
stop()
Request the RPLIDAR core to stop the me as asurement scan
operation.
grabScanData()
Grab a complete 360-degrees scan data sequence.
ascendScanData()
Rank the scan data from grabScanData() as the angle inscreases.