SDK and Demo Program SLAMTEC provides open-sourced SDK and demo program for customers to integrate RPLIDAR into their systems quickly. The SDK implements all the communication stacks, driver logics and related data structures described in this...
Request/Response Modes Host System RPLIDAR Send a Request Packet Perform Waiting for Some Reply a Response Packet Response Operation Another Request Figure 2-1 RPLIDAR Request/Response Modes 4 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 5
The host system can interrupt RPLIDAR and let it leave the multiple responses mode by sending a STOP request or any request packet. After leaving the multiple 5 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
The response descriptors carry the information of the incoming data responses. All the response descriptors share a same format. 7 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 8
Start Flag1 Start Flag2 Data Response Length Send Mode Data Type 30bits 2bits 1byte (0xA5) 1byte (0x5A) 1byte Transmission Order Figure 2-7 RPLIDAR Response Descriptors’ Format 8 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 9
Different from response descriptors, there is no common format used among response data packets. Each type of response data has its own data format and packet length based on its type. 9 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Protection Stop state. A host system can still communicate with an RPLIDAR in the Protection Stop state to query its working 10 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Idle or Protection Stop state. Since RPLIDAR won’t send response packet for this request, host systems should wait for at least 1 millisecond (ms) before sending another request. 12 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Note: RPLIDAR A2 and other device models support 4khz sampling rate will lower the sampling rate when processing this request. Please use EXPRESS_SCAN for the best performance. 13 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 14
Format of the Data Response Packets: ҧ Quality Byte Offset angle_q6[6:0] angle_q6[14:7] distance_q2[7:0] distance_q2[15:8] Figure 4-4 Format of a RPLIDAR Measurement Result Data Response Packet 14 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 15
Figure 4-5 Field Definition of a RPLIDAR Measurement Result Data Response Packet The geometric definition of the included angle and distance value is shown as below: θ [0,360) Figure 4-6 Angle and Distance Value Geometric Definition for RPLIDAR A1 series 15 / 32 Copyright (c) 2009-2013 RoboPeak Team...
Page 16
Data transmission order: a new request … … … scan a new scan Figure 4-8 The Communication Status after Host System Sending a SCAN Request 16 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
RPLIDAR work at 4khz sampling rate and output measurement sample data accordingly; for the device models with the 2khz sample rate (such as RPLIDAR A1 series), this request will implement the same sampling rate as the scan(SCAN) request.
Page 18
0. Reserved Reserved field, set to 0. Reserved for future use, set to 0. Figure 4-10 Field Definition of RPLIDAR Express Scan Data Request Packet 18 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 19
Therefore, an express scan data response packet carries 32 measurement sampling data points. 19 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 20
A data response packet contains 16 group of cabin data. Figure 4-12 Field Definition of RPLIDAR Express Scan Data Response Packet 20 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 21
A new request … 82 05 … … … 360o scan A new scan Figure 4-14 The Communication Status Sending Out the Express Scan Request 21 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 22
. It carries the distance value and the included angle compensation corresponded with the current measurement sampling point. 22 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
RPLIDAR uses the similar processing logic for this request and the same response format as the one of the scan(SCAN) request, but uses the different response format. 23 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Format of the Device Info Response Packets: Byte Offset model firmware_minor firmware_major hardware serialnumber[0] … serialnumber[15] Figure 4-16 Format of a Device Info Data Response Packet 24 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Page 25
Figure 4-17 Field Definition of Device Info Data Response Packet Data transmission order: A new request … Figure 4-18 The Timing Sequence of a GET_INFO Request 25 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
When a host system detects RPLIDAR has entered the Protection Stop state, it can set a RESET request to let RPLIDAR core system reboot to escape the Protection 26 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Process sample data Check motor status Send a STOP request End of operation? Wait for 1ms Figure 5-1 Recommendation for Starting RPLIDAR Scanning and Data Retrieving 28 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
PWM Motor Driver Motor Data Interface Rotation Speed Core System Detector Host System RPLIDAR A1 Figure 5-2 Block Diagram of RPLIDAR A1 Speed Detection and Control System RPLIDAR A2Mx Series PWM Motor Driver Motor Data Interface Rotation Speed Core System Detector...
Page 30
So the actual scan speed can be calculated using the following equation: RPM = ∗ 60 ∆ The calculated value can be used as a feedback to control the motor speed. 30 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Fixed a description bug in the EXPRESS_SCAN protocol section 2017-05-15 Release 1.0 Version 2018-03-08 Added notes for higher class scan modes in Express Mode protocol 31 / 32 Copyright (c) 2009-2013 RoboPeak Team Copyright (c) 2013-2017 Shanghai Slamtec Co., Ltd.
Need help?
Do you have a question about the RPLIDAR A1 and is the answer not in the manual?
Questions and answers