Fix vector, quaternion, pid and lpf libraries curly braces code style

This commit is contained in:
Oleg Kalachev
2024-02-06 13:50:56 +03:00
parent 31d382dd86
commit 410fccf015
4 changed files with 36 additions and 72 deletions
+3 -6
View File
@@ -13,8 +13,7 @@ public:
LowPassFilter(float alpha): alpha(alpha) {};
T update(const T input)
{
T update(const T input) {
if (alpha == 1) { // filter disabled
return input;
}
@@ -26,13 +25,11 @@ public:
return output = output * (1 - alpha) + input * alpha;
}
void setCutOffFrequency(float cutOffFreq, float dt)
{
void setCutOffFrequency(float cutOffFreq, float dt) {
alpha = 1 - exp(-2 * PI * cutOffFreq * dt);
}
void reset()
{
void reset() {
initialized = false;
}