Week 11 (2) – Oliver – 2019

Today I attempted to make my program work on the only bit it was failing on – getting over the ramp reliably. I had previously tried to get over the ramp with a flag variable called rampFound like in James’s code, but when I was looking in Port View I noticed that, although I had written my code to recognise a ramp when the values were within 5 of each other, when the robot approached the ramp they were, in fact, not. The reflected light values were actually the same as when the robot was following the black line, except reflected slightly less. This would explain why only when both sensors were on black, the ramp program worked.

I also realised that, instead of triggering the flag variable at the bottom of the ramp, it sometimes triggered at the top. I originally had the distance the robot went when it detected the ramp set to 2.3 full wheel rotations, but as the robot only had to come down from the top of the ramp I set it to 1.5. However, the robot recognised a hint at the top of the ramp and turned left before the robot realised it was on a ramp and fell off the edge.

My line follower so far, hopefully going to work for next year!

A possible solution to this problem could be to change my hints to only trigger after the program confirms that the ramp is not found, or to change my hint direction to straight, like Sara’s code. However, today was our last coding session and we were running out of time, so I decided to leave my code for the time being and help Sara get her code to stop on silver and run the can finder. As I had worked on stopping on silver and can finders before, I could work with Sara to make a flag variable and a can finder. I have explained my can finder in the blog last year.

This is our final competition code after working with Sara and making a few changes:

The competition code.

I am looking forward to the tournament on Thursday and am excited to see what ideas the other teams do and learning from their code.

Fact of the Day: Owls are the only birds that can see the colour blue.