mirror of https://github.com/ArduPilot/ardupilot
uncrustify libraries/Filter/DerivativeFilter.cpp
This commit is contained in:
parent
e5b317cb42
commit
973dcba9ab
|
@ -51,8 +51,8 @@ float DerivativeFilter<T,FILTER_SIZE>::slope(void)
|
||||||
|
|
||||||
// use f() to make the code match the maths a bit better. Note
|
// use f() to make the code match the maths a bit better. Note
|
||||||
// that unlike an average filter, we care about the order of the elements
|
// that unlike an average filter, we care about the order of the elements
|
||||||
#define f(i) FilterWithBuffer<T,FILTER_SIZE>::samples[(((FilterWithBuffer<T,FILTER_SIZE>::sample_index-1)+i+1)+3*FILTER_SIZE/2) % FILTER_SIZE]
|
#define f(i) FilterWithBuffer<T,FILTER_SIZE>::samples[(((FilterWithBuffer<T,FILTER_SIZE>::sample_index-1)+i+1)+3*FILTER_SIZE/2) % FILTER_SIZE]
|
||||||
#define x(i) _timestamps[(((FilterWithBuffer<T,FILTER_SIZE>::sample_index-1)+i+1)+3*FILTER_SIZE/2) % FILTER_SIZE]
|
#define x(i) _timestamps[(((FilterWithBuffer<T,FILTER_SIZE>::sample_index-1)+i+1)+3*FILTER_SIZE/2) % FILTER_SIZE]
|
||||||
|
|
||||||
if (_timestamps[FILTER_SIZE-1] == _timestamps[FILTER_SIZE-2]) {
|
if (_timestamps[FILTER_SIZE-1] == _timestamps[FILTER_SIZE-2]) {
|
||||||
// we haven't filled the buffer yet - assume zero derivative
|
// we haven't filled the buffer yet - assume zero derivative
|
||||||
|
|
Loading…
Reference in New Issue