Hello,
My name is Marius and after i bought a 3pi robot i decided to build one myself for a line followers competition that will take place next year, the problem is that i have to make the robot to do a small drift and then stop at the end of the line where is a 10X10 cm square and i havent been able to do it so far,so it would be awesome if you could help me.
I get the sense that the code you posted is fairly complete in terms of basic line-following (correct me if I’m wrong, and if so, please describe what the robot is doing vs. what it should be doing) and so I assume this quoted bit describes the part you are struggling with. Unfortunately, I’m not quite sure I understand what you’re trying to do. Could you explain a bit further, please? (Are you simply trying to make the robot stop when it reaches a large region of electrical tape?)
Right now the robot is following the line very good and i need to add the stopping part but i didnt really understand how to do this from the information i found on the internet about the orangutan libraries.So all i have left to do is make the robot stop when it reaches a large region of tape.My first ideea was to write a ‘if(all sensors are on the line)’ and read the sensors to make it stop.
This is exactly the approach you want to use. You might consider some code like the following, which, with some small modifications specific to your program/purposes, will provide the effect you are looking for.