1 | initial version |
These line following robots usually use always the same tricks.
If you detect two lines, you can easily find out the center of these two lines by calculating the mean position of both lines.
Then, if the center of the image (where the robot is looking at) is not aligned with the center of the two lines, you just need to compensate by moving left or right, depending on which direction the offset is.
These is pretty basic computer vision and programming algorithms in general, if you can't think of a way of translating this into code then you need some more practice :)
Good luck!
2 | No.2 Revision |
These line following robots usually use always the same tricks.
If you detect two lines, you can easily find out the center of these two lines by calculating the mean position of both lines.
Then, if the center of the image (where the robot is looking at) is not aligned with the center of the two lines, you just need to compensate by moving left or right, depending on which direction the offset is.
These is are pretty basic computer vision and programming algorithms in general, if you can't think of a way of translating this into code then you need some more practice :)
Good luck!