Well if that's okay for you, I have a few questions regarding your algorithms for re-finding the line after edges or after gaps. After the edges, it seems like the robot sometimes loses the line and then there's an algorithm for re-finding the line by checking left and right for the line (like turning until there's a line or something). At least that's what it looks like in 3:02. I would like to understand how this logic works and when this checking process occurs. How does the robot determine that it has lost the line? Secondly, the thing with the gaps. It's seems pretty interesting in my opinion. In some cases, the robot goes back to the beginning of the gap to realign itself (like in 0:30). So I wonder, what's the logic and algorithm behind this and here again, when does it run the algorithm? And it sometimes also seems that the robot realign itself after a gap by turning and going back, but how does this work (like in 0:38)? And when does it do it? These are the things I wonder about. If you're willing to share your algorithms and logics behind these, I would really appreciate it. Me for myself, I'm a german team participating in national, but no international RoboCup competition. And my team's currently working on perfecting our line-following. However, I really appreciate your work. Looks very solid.
I apologize for keeping you waiting so long for an answer. I rarely check the comments on these videos, but I was reminiscing about my time participating in the competition (I no longer compete as I'm currently studying Computer Science), so consider yourself lucky that I saw your comment! I'm glad you're curious about our robot. When I was competing, I also spent hours watching videos of international teams to understand their algorithms, and that helped me a lot. Now, I'll explain the doubts you sent. At minute 3:02, what happened was that the robot identified the green color on the opposite side of the 90º curve. The color sensor was faulty, and we didn’t have spare sensors, as this sensor (Hitechnic Color Sensor) is very expensive in Brazil. The logic to identify the green color and the correct side of the 90º curve works together. The robot usually gets the correct side of the curve right with 98% accuracy. So, if you saw it turning to the wrong side in that situation, it was because of the faulty sensor, which incorrectly identified the green color. The fact that it corrected itself and returned to the correct side is due to the safety system I implemented to deal with this type of issue. When the robot turns and doesn’t find the line, it simply returns and continues on its path. This also happens at minute 3:32, but in other situations, it doesn’t happen because only the left sensor was faulty. (I recommend watching the videos from later rounds, where we opened the sensor and partially solved the problem). Regarding the line recovery logic, it’s quite simple. The robot has a dismantled NXT light sensor to fit between the two Hitechnic color sensors, and it’s positioned between them. When the robot is off the line for too long, it backs up until it identifies the line again, and then it backs up a bit more. This allows the line follower logic to realign the robot correctly on the course. This behavior is evident at minute 4:34. The confusion at minute 0:38 is simply the line follower adjusting the robot to keep it on the correct path. If you notice, the spin on its own axis is the robot executing the logic for 90º and tight turns. The tip I can give you is to try to keep your code as generic as possible, so the robot can handle confusing situations like the one at minute 0:38. When you create too many specific conditions in the code, the robot might struggle to deal with unexpected situations.
Well if that's okay for you, I have a few questions regarding your algorithms for re-finding the line after edges or after gaps.
After the edges, it seems like the robot sometimes loses the line and then there's an algorithm for re-finding the line by checking left and right for the line (like turning until there's a line or something). At least that's what it looks like in 3:02. I would like to understand how this logic works and when this checking process occurs. How does the robot determine that it has lost the line?
Secondly, the thing with the gaps. It's seems pretty interesting in my opinion. In some cases, the robot goes back to the beginning of the gap to realign itself (like in 0:30). So I wonder, what's the logic and algorithm behind this and here again, when does it run the algorithm? And it sometimes also seems that the robot realign itself after a gap by turning and going back, but how does this work (like in 0:38)? And when does it do it?
These are the things I wonder about. If you're willing to share your algorithms and logics behind these, I would really appreciate it. Me for myself, I'm a german team participating in national, but no international RoboCup competition. And my team's currently working on perfecting our line-following. However, I really appreciate your work. Looks very solid.
I apologize for keeping you waiting so long for an answer. I rarely check the comments on these videos, but I was reminiscing about my time participating in the competition (I no longer compete as I'm currently studying Computer Science), so consider yourself lucky that I saw your comment! I'm glad you're curious about our robot. When I was competing, I also spent hours watching videos of international teams to understand their algorithms, and that helped me a lot. Now, I'll explain the doubts you sent.
At minute 3:02, what happened was that the robot identified the green color on the opposite side of the 90º curve. The color sensor was faulty, and we didn’t have spare sensors, as this sensor (Hitechnic Color Sensor) is very expensive in Brazil. The logic to identify the green color and the correct side of the 90º curve works together. The robot usually gets the correct side of the curve right with 98% accuracy. So, if you saw it turning to the wrong side in that situation, it was because of the faulty sensor, which incorrectly identified the green color. The fact that it corrected itself and returned to the correct side is due to the safety system I implemented to deal with this type of issue. When the robot turns and doesn’t find the line, it simply returns and continues on its path. This also happens at minute 3:32, but in other situations, it doesn’t happen because only the left sensor was faulty. (I recommend watching the videos from later rounds, where we opened the sensor and partially solved the problem).
Regarding the line recovery logic, it’s quite simple. The robot has a dismantled NXT light sensor to fit between the two Hitechnic color sensors, and it’s positioned between them. When the robot is off the line for too long, it backs up until it identifies the line again, and then it backs up a bit more. This allows the line follower logic to realign the robot correctly on the course. This behavior is evident at minute 4:34. The confusion at minute 0:38 is simply the line follower adjusting the robot to keep it on the correct path. If you notice, the spin on its own axis is the robot executing the logic for 90º and tight turns.
The tip I can give you is to try to keep your code as generic as possible, so the robot can handle confusing situations like the one at minute 0:38. When you create too many specific conditions in the code, the robot might struggle to deal with unexpected situations.