LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
emaFilter.hpp
Go to the documentation of this file.
1
/*
2
* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
*/
6
#pragma once
7
8
#include "
okapi/api/filter/filter.hpp
"
9
10
namespace
okapi
{
11
class
EmaFilter
:
public
Filter
{
12
public
:
18
explicit
EmaFilter
(
double
ialpha);
19
26
double
filter
(
double
ireading)
override
;
27
33
double
getOutput
()
const override
;
34
40
virtual
void
setGains
(
double
ialpha);
41
42
protected
:
43
double
alpha
;
44
double
output
= 0;
45
double
lastOutput
= 0;
46
};
47
}
// namespace okapi
okapi::EmaFilter
Definition
emaFilter.hpp:11
okapi::EmaFilter::output
double output
Definition
emaFilter.hpp:44
okapi::EmaFilter::lastOutput
double lastOutput
Definition
emaFilter.hpp:45
okapi::EmaFilter::EmaFilter
EmaFilter(double ialpha)
Exponential moving average filter.
okapi::EmaFilter::getOutput
double getOutput() const override
Returns the previous output from filter.
okapi::EmaFilter::alpha
double alpha
Definition
emaFilter.hpp:43
okapi::EmaFilter::filter
double filter(double ireading) override
Filters a value, like a sensor reading.
okapi::EmaFilter::setGains
virtual void setGains(double ialpha)
Set filter gains.
okapi::Filter
Definition
filter.hpp:9
filter.hpp
okapi
Definition
chassisController.hpp:16
include
okapi
api
filter
emaFilter.hpp
Generated by
1.9.8