|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#12
|
||||
|
||||
|
Re: Gyro angle in simulation vs reality?
Here's a possible implementation of Joe's suggestion. Code:
// initialization: alpha=Go=getGyroReading(); // range -180 to +180 // iteration: G=getGyroReading(); d=G-Go; Go=G; if (d>180) d-=360; else if (d<-180) d+=360; alpha+=d; // alpha is the continuous angle reading you've been asking for |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|