I have a mobile robot that has a distance sensor attached to a panning servo motor. The motor rotates continuously to move the sensor from 0 to 180 degrees and back.
The distance sensor sends a signal every few miliseconds to scan its surroundings for obstacles. One can visualise the data generated by the distance sensor like this:
I wish to create an algorithm that allows the robot to move in the direction where there is the most space available (or the least obstacles).
More formally, I can represent the inputs and outputs like:
input: array of distances to the nearest object for each angle of motor rotation.
output: a single value representing the optimal angle.
The requirements for the algorithm are:
- should not be susceptible to outliers in data (the sensors sometimes spike unpredictably)
- does not need to be absolutely optimal, 1-2% off is acceptable
- efficient (this will run on a small microprocessor)
- understandable to a hobbyist (I am not a ML expert ;) )