If you're using the Gyro, you'll want to make sure you're resetting it properly. The best gyro reset code that we have found comes from the Hoosier Girlz
via Droid Robotics
advanced lesson #5. If your Gyro occasionally starts to drift, this is for you...
While gyro is calibrating, it returns 'NaN' which stands for "Not a Number". NaN's are a serious pain and cause all sorts of problems in real world code. Taking the square root of -1 is one way to geneate a NaN in 'real' programming languages. Anyways, NaN's have the interesting property that they return false when compared to other numbers. This allows the clever EV3 programmer (ie, the Hoosier Girlz) to detect them and wait for the Gyro to reset.
Step 1: Read both the Angle and Rate at the same time
Step 2: Start a loop
Step 3: Read the angle
Step 4: Check to see if the Angle is >= 0
Step 5: Check to see if the angle is < 0
Step 6: "or" the results of steps 4,5 together
If the result of step 6 is true, then the number is >=0 or <0 so you're good to go
If the result of step 6 is false, then the number must be NaN (it's not >=0 or <0) so repeat the loop.
This solved all of our Gyro drift problems and I think it is something that all teams should know and understand. Honestly, the 'reset' block should have come standard with the EV3 environment. It's hard enough to use the Gyro when it's calibrated correctly. When it's not it can waste valuable team time.
In response to Droid Robotic's efforts, our team shared their Proportional Control turn code (which is made even better with a calibrated gyro!). If your teams have any basic building blocks that they want to share, the guys at Droid Robotics appear to be compiling a very nice set of building blocks that are easy to understand and explain to FLL kids. What I like about them is that they don't just re-post solutions, they take the time to understand what's going on and explain it in a way that kids their age will understand. I think it's a great project and I fully support what they're doing.
Coach "The Construction Mavericks"