dragonpilot - 基於 openpilot 的開源駕駛輔助系統
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
class FirstOrderFilter():
|
|
|
|
# first order filter
|
|
|
|
def __init__(self, x0, ts, dt):
|
|
|
|
self.k = (dt / ts) / (1. + dt / ts)
|
|
|
|
self.x = x0
|
|
|
|
|
|
|
|
def update(self, x):
|
|
|
|
self.x = (1. - self.k) * self.x + self.k * x
|
|
|
|
return self.x
|