Drift-compensated angle in gyro (#931)

* compute angle based on undrifted rate

* add is calibrating function

* fix integrator

* added example

* docs

* poll faster
This commit is contained in:
Peli de Halleux
2019-10-01 10:11:58 -07:00
committed by GitHub
parent 25452efc92
commit 374bbb8304
11 changed files with 192 additions and 78 deletions

View File

@ -0,0 +1,21 @@
# Pause Until Rotated
Pauses the program until the gyro sensors detect that the desired amount of rotation
has been acheived.
```
sensors.gyro2.pauseUntilRotated(90)
```
## Example
This program performs a square turn left, then right.
```blocks
sensors.gyro2.calibrate()
motors.largeBC.steer(200, 10)
sensors.gyro2.pauseUntilRotated(90)
motors.largeBC.steer(-200, 10)
sensors.gyro2.pauseUntilRotated(-90)
motors.largeBC.stop()
```