Program for line following robot with dotted line

Dear experts as per the below robot path please provide the little advise to
program for line following robot with dotted line but without getting effected to the dead end line up
My robot Meze following is working properly but during the dotted line following area the robot get turn around

Since you have a dead end and a dashed line in the same course, the way I would probably go about it is to first detect when the line suddenly disappears. One way you can do this is by keeping track of the previous line reading, and when your robot no longer senses the line, check and see if the previous reading was toward the middle of the line sensor array. If it was, break out of your normal line following routine and have the robot move straight forward for a short amount of time while continuing to take line sensor readings. If the line is detected again before the designated time is up, it was a line break and the robot can go back to following the line again (this will repeat through each dash in the line). Otherwise, if the line wasn’t detected before the designated time limit, it must have been a dead end and it should do a U-turn.


Thanks Brandom

I think you explained about Maze follower code is doing …Isn’t it ?

In this case bit straight + lineup + dash_detec Then total length is very high , Then meat near the next line
Please advice

Yes, it is very similar to basic maze solving methods. Maze solving methods generally try to identify an intersection and consider which combination of the following conditions have been found:

Left turn
Right turn

The steps for doing this are similar to what I described (once you identify the intersection, drive forward a short amount and keep track of what your sensors are seeing, then analyze them). Essentially, I’m suggesting adding one additional edge case: when a U-turn is found, drive forward another short amount and see if the line is suddenly detected again to make sure it wasn’t a dashed line instead.