MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / __init__

Method __init__

leaderboard/team_code/pid_controller.py:7–14  ·  view source on GitHub ↗
(self, K_P=1.0, K_I=0.0, K_D=0.0, n=20)

Source from the content-addressed store, hash-verified

5
6class PIDController(object):
7 def __init__(self, K_P=1.0, K_I=0.0, K_D=0.0, n=20):
8 self._K_P = K_P
9 self._K_I = K_I
10 self._K_D = K_D
11
12 self._window = deque([0 for _ in range(n)], maxlen=n)
13 self._max = 0.0
14 self._min = 0.0
15
16 def step(self, error):
17 self._window.append(error)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected