Hii contributors
Need some guidance on how to use RPlidar for discance measurement for AGV robot
- Using arduino mega
- Mosfet H bridge motor controller 4 motor
- Using QMC 5883 magnetometer compass
On the simple connect example below
void loop() {
if (IS_OK(lidar.waitPoint())) {
float distance = lidar.getCurrentPoint().distance; //distance value in mm unit
float angle = lidar.getCurrentPoint().angle; //anglue value in degree
bool startBit = lidar.getCurrentPoint().startBit; //whether this point is belong to a new scan
byte quality = lidar.getCurrentPoint().quality; //quality of the current measurement
//perform data processing here...
I want to use the RPLidar to check on the path of the robot to avoid obstacle just as we use ultrasonic sensors data.
A. Float distance on above sketch in example, does it orient with the direction of movement
Ie at what angle when lidar is rotatibg from 0 degree to 360
How can i get the distance at various angles ?
I mean if robot is travellibg forward say north, at 45 degree turn can lidar calculate soecific distance at that angle from an obstacle ?
I ran the sample exe file at the slamtec site which shows lidar scan in a grid. This program has a scan ar all angle and distances.
Kindly guide.
Thanks a lot