-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
535e4cf
commit ae35d8b
Showing
24 changed files
with
8,689 additions
and
8,635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
33fbac06369f5bf11a69f69fbfd44d9348159aec | ||
dccaf109dbb3390bdd324df2834753b42018e721 |
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include <Arduino.h> | ||
#include "KalmanFilter.h" | ||
#include "MinFilter.h" | ||
#include "..\Math\Mathematics.h" | ||
|
||
class DerivativeFilter{ | ||
private: | ||
KalmanFilter<10> output = KalmanFilter<10>(0.2f); | ||
MinFilter<40> minFilter; | ||
float previousReading = 0.0f; | ||
float outputValue = 0.0f; | ||
|
||
public: | ||
DerivativeFilter(){} | ||
|
||
float GetOutput(){ | ||
return outputValue; | ||
} | ||
|
||
float Filter(float value){ | ||
float amplitude = fabs(value - previousReading); | ||
float normalized = output.Filter(amplitude); | ||
float minimum = minFilter.Filter(normalized); | ||
|
||
previousReading = value; | ||
outputValue = Mathematics::Constrain(normalized - minimum, 0.0f, 1.0f); | ||
|
||
return outputValue; | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ae35d8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man i need to catch up on how this all works lol. I am kinda lost since there is so many changes i cant keep up with how it overall functions your program.