Week 6 – James

Hi it’s James here. This week we started our goal which is doing a line – following challenge like the one in Robocup Junior ( Our course looks like this).

This is basically what the course looks like at Robocup Junior. ( It’s only missing a ramp)

We looked an algorithm on how to make the robot follow a line. We followed a section of the course going the opposite direction of where the robot is facing in the picture, above.  The robot can’t follow the middle of the line because it can’t see the black line ahead of itself like a human can.  If you look at the code below it is coded to follow one side of the line. (mine was the right side).

If the robot is placed on the left side of the line it turns around and goes the wrong way. When it follows the right side, it jiggles side to side like this.

The algorithm is repeating forever moving away from the black line and when the color sensor is on the color white, it moves back towards the black line.

To make the code work I adjusted the speed to 35 and then I made several adjustments to the turning starting from 45 and -45 and going to 70 and -70.

I had several problems like with the switch block and other things in the code  but here are the main problems I had…

  • My speed was too fast to get around some corners.
  • I turned too much when doing the jiggle.

I could make my code better by adding some more comments.