Manual

12 / 18
Copyright (c) 2009-2013 RoboPeak Team
Copyright (c) 2013-2016 Shanghai Slamtec Co., Ltd.
o rplidar_protocol.h
This header defines low-level data structures and constants for RPLIDAR protocol.
o rplidar_cmd.h
This header defines request/answer data structures and constants for RPLIDAR
protocol.
o rptypes.h
This header defines platform-independent data structures and constants.
SDK Initialization and Termination
User programs are required to create an RPlidarDriver instance via SDK before
communicating with an RPLIDAR device. It can be implemented by using the
following static function is used:
RPlidarDriver *RPlidarDriver::CreateDriver (_u32 drivertype)
Each RPlidarDriver instance is bound to only one RPLIDAR device at the same time.
But user programs can freely allocate arbitrary number of RPlidarDriver instances
and make them communicates with multiple RPLIAR devices concurrently.
Once user programs finish operations, all previously created RPlidarDriver
instances should be released explicitly using the following static function in order
to free system memory.
RPlidarDriver::DisposeDriver(RPlidarDriver * drv)
Connecting to an RPLIDAR
After creating an RPlidarDriver instance, the user program should invoke the
connect() function firstly to open the serial port and connect with the RPLIDAR
device. All RPLIDAR operations require invoking the connect() function first.
u_result RPlidarDriver::connect(const char * port_path, _u32
baudrate, _u32 flag = 0)
The function returns RESULT_OK for success operation.