Best line following algorithm?
This has become a recent geek’s obsession of mine and I cannot get it out of my head. I am trying to build a robot (admittedly, out of LEGO Mindstorms) that will follow a black line in two directions with one color sensor. Could someone please present me with an algorithm (in plain English) that would let this work?
Observing members:
0
Composing members:
0
4 Answers
This brings back memories of the robotics club in high school. Unfortunately, I was the engineer and not the programmer. :[
Umm, you might want to look at this. It seems like a simple explanation of line following for robots.
@nxknxk Thanks anyway.
I have already looked at the first example in the link you gave me. Unfortunately it does not work as I want to follow the line in two directions, whereas that algorithm only allows you to follow lines that curve in one direction.
@haegenschlatt You need 3 sensors for that, as you can see from the link above in @nxknxk ‘s note. If you want to be fast, with minimal overshoot and undershoot, you need 5 sensors.
You might be able to have the 1-sensor robot follow a serpentine path and rewrite the algorithm so that ‘right’ and ‘left’ have some meaning for even the single sensor. It would be a physically slow robot but ‘surefooted’ <g>.
Doesn’t Lego mindstirms have a very simple drag and drop interface? Not sure if it was changed.
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.