Treehopper C# API
|
A simple filter for fusing accelerometer and gyroscope data together to determine roll and pitch. More...
Public Member Functions | |
delegate void | FilterUpdateEventHandler (object sender, EventArgs e) |
Delegate of the callback function to be invoked when the filter is updated More... | |
ComplementaryFilter (IAccelerometer accelerometer, IGyroscope gyroscope, int samplePeriodMs=10, bool useHighResolutionTimer=false) | |
Construct a new Complementary filter with the specified accelerometer and gyroscope (which is often the same IC) More... | |
void | Dispose () |
Shut down the polling loop and dispose of this filter More... | |
Properties | |
double | Pitch [get] |
The current calculated pitch More... | |
double | Roll [get] |
The current calculated roll More... | |
double | Yaw [get] |
The yaw reported by the gyroscope. More... | |
Events | |
PropertyChangedEventHandler | PropertyChanged |
Fires whenever a property has been updated More... | |
FilterUpdateEventHandler | FilterUpdate |
Fires after the filter update function has executed More... | |
A simple filter for fusing accelerometer and gyroscope data together to determine roll and pitch.
ComplementaryFilter | ( | IAccelerometer | accelerometer, |
IGyroscope | gyroscope, | ||
int | samplePeriodMs = 10 , |
||
bool | useHighResolutionTimer = false |
||
) |
Construct a new Complementary filter with the specified accelerometer and gyroscope (which is often the same IC)
accelerometer | The accelerometer to use |
gyroscope | The gyroscope to use |
samplePeriodMs | The sample period to poll these devices at |
useHighResolutionTimer | Whether to use an accurate (but CPU-hungry) timer |
delegate void FilterUpdateEventHandler | ( | object | sender, |
EventArgs | e | ||
) |
Delegate of the callback function to be invoked when the filter is updated
sender | The filter that called this function |
e | An empty EventArgs object |
void Dispose | ( | ) |
Shut down the polling loop and dispose of this filter
|
get |
The current calculated pitch
|
get |
The current calculated roll
|
get |
The yaw reported by the gyroscope.
This value will drift, as the accelerometer cannot correct for it
PropertyChangedEventHandler PropertyChanged |
Fires whenever a property has been updated
FilterUpdateEventHandler FilterUpdate |
Fires after the filter update function has executed