Notifications
Clear all
I/O Devices - Sensors - Modules
2
Posts
2
Users
0
Likes
4,415
Views
Topic starter
2019-06-15 11:30 am
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
2019-06-15 11:50 am
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