There're many other threads about this.
The Yaw Rate Sensor does not detect absolute angle. It detects rotational velocity.
If you want to detect something like when you start to go up the ramp, you can wait until you see an extreme output from the sensor (the jerk as the front of the robot picks up, onto the ramp), and wait until you get another extremely low output (but high and low are relative to how you have the sensor mounted).
If you were to do this, you'd want to program a "deadband" into the system, so that smaller jerks don't just trick your system into thinking it's going up the ramp, when it just ran into a bin, or some such problem.
Hope this helps.
I'm sorry I don't have any code for this, but that's another thing I have to get around to, eventually.
