Notifications
Clear all

RP LIDAR 360 DEGREE DISTANCE

2 Posts
2 Users
0 Reactions
4,446 Views
soumitra
(@soumitra)
Member
Joined: 5 years ago
Posts: 61
Topic starter  

Hi

Ref to Rplidar , wonderful episode on same, trying to get the robot scan disctance 360 degree to detect obstacle to choose best path to move, ref similar to the RGB Led example .

The example code: 

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

if(angle <= 255){
distances[int(angle)] = int(distance);
}

//perform data processing here...

 

Able to get a single point distance only. If anyone worked on the sketch to make each point measured then do share please. Thanks a lot.

 

 

This topic was modified 5 years ago by soumitra

   
Quote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1094
 

Hi sdey76

Thanks so much for your question!

Hope you don't mind but I moved your question to the "Components & Programming" section as it isn't necessarily related to the DB1 robot. I also used the "code " tag so that your code displays a bit easier.

?

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote