I do not think I can give a complete answer, but a few thoughts on where to go.
What do you mean in real time? How long can it take to execute any given algorithm? And which processor works in your program?
Filtering out points within your detection area should be pretty simple if you check to see if abs(x) < 0.75
and y< 2 && y > 0
. In addition, you should only consider points that are far enough from 0, so x^2 + y^2 > d
. But that should be the trivial part.
More interestingly, it will detect groups of points. DBSCAN turned out to be a pretty good clustering algorithm for detecting two-dimensional groups of points. The critical question here is that DBSCAN is fast enough for real-time applications. If not, you might have to consider optimizing the algorithm (you can overlay it on n * log (n) with some smart indexing structures).
In addition, it may be worth considering how you can use the knowledge that you have from your last iteration (assuming a high frequency, data points should not change much).
Perhaps it’s worth looking at other projects in the field of robotics - I could imagine that the problem of interpreting these sensors to create information about the environment is quite common.
UPDATE
It’s quite difficult to give you good advice without knowing where you come across DBSCAN for your problem. But let me try to give you a step-by-step guide on how the algorithm works:
- For each data you receive, you check whether it is in the region that you want to observe. (The conditions mentioned above should work).
- If the datapoint is in a region, you save it in some list
- After reading all the data points, you check to see if the list is empty. If so, all is well. Otherwise, we need to check if there are more groups of data points that you need to move.
Now comes the more difficult part. You throw DBSCAN at these points and try to find groups of points. What parameters will work for an algorithm that I do not know is a must try. After that you should have several clusters of points. I'm not quite sure what you will do with the groups - the idea would be to find the points of each group having a minimum and maximum degree in polar coordinates. This way you can decide how far you have to turn your car. Particular care must be taken if the two groups are so close that it will not be possible to bridge the gap between them.
To implement DBSCAN, you can here or just ask Google to ask for help. This is a fairly common algorithm that has been encrypted thousands of times. For further optimizations regarding speed, it may be useful to create your own implementation. However, if one of the implementations you implemented seems to be suitable for use, I would try to do this before I go all the way and implement it myself.
If you encounter certain problems when implementing the algorithm, I would suggest creating a new question, since it is far from this, and you can get more people who are ready to help you.
Hopefully now everything is a little clear. If not, indicate the exact point you are in doubt about.