lateral control jitter solvedgit add PythonAPI/source/carla/navigation/controller.py

This commit is contained in:
German Ros 2018-12-13 15:02:19 -08:00 committed by nsubiron
parent d544c6515e
commit 7f52942529
1 changed files with 1 additions and 2 deletions

View File

@ -205,7 +205,6 @@ class PIDLateralController():
self._K_D = K_D
self._K_I = K_I
self._dt = dt
self._eps = -0.1
self._e_buffer = deque(maxlen=10)
def run_step(self, waypoint):
@ -238,7 +237,7 @@ class PIDLateralController():
_dot = math.acos(np.dot(w_vec, v_vec) /
(np.linalg.norm(w_vec) * np.linalg.norm(v_vec)))
_cross = np.cross(v_vec, w_vec)
if _cross[2] < -self._eps:
if _cross[2] < 0:
_dot *= -1.0
self._e_buffer.append(_dot)