General Question

haegenschlatt's avatar

Best line following algorithm?

Asked by haegenschlatt (122points) November 2nd, 2009

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

nxknxk's avatar

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.

haegenschlatt's avatar

@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.

virtualist's avatar

@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>.

XOIIO's avatar

Doesn’t Lego mindstirms have a very simple drag and drop interface? Not sure if it was changed.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther