Skip to content

Club-INTech/rplidar_a2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SLAMTEC RPLiDAR A2 C++ Library

API

- RPLidar class

bool RPLidar::init_port(const char* serial_path)
  • Initializes internal buffers and Serial Port.
  • Stops scans and motor.
  • Returns the success of the operation.
bool RPLidar::start()
  • Starts the motor of the lidar.
  • Waits 2 seconds for its speed to stabilize.
  • Starts Express Scans (see the RPLidar A1&A2 Communication protocol note).
  • Returns true in case of success for both the motor start and scan start operations.
bool RPLidar::stop()
  • Stops current Scan.
  • Stops the motor of the lidar(tries rp_values::NUMBER_PWM_TRIES times as we do not have any information on the success).
  • Returns true in case of success for both the motor stop and scan stop operations.
bool RPLidar::close()
  • Closes file descriptor for the used serial port.
  • Returns the success of the file close operation.