Better steering for manual control (#1957)
This commit is contained in:
parent
f83cea732e
commit
70e67b8dbd
|
@ -1,4 +1,5 @@
|
|||
## Latest
|
||||
* Better steering in manual control
|
||||
* Added Doxygen documentation online with automatic updates through Jenkins pipeline
|
||||
|
||||
|
||||
|
|
|
@ -337,9 +337,15 @@ class KeyboardControl(object):
|
|||
self._control.throttle = 1.0 if keys[K_UP] or keys[K_w] else 0.0
|
||||
steer_increment = 5e-4 * milliseconds
|
||||
if keys[K_LEFT] or keys[K_a]:
|
||||
self._steer_cache -= steer_increment
|
||||
if self._steer_cache > 0:
|
||||
self._steer_cache = 0
|
||||
else:
|
||||
self._steer_cache -= steer_increment
|
||||
elif keys[K_RIGHT] or keys[K_d]:
|
||||
self._steer_cache += steer_increment
|
||||
if self._steer_cache < 0:
|
||||
self._steer_cache = 0
|
||||
else:
|
||||
self._steer_cache += steer_increment
|
||||
else:
|
||||
self._steer_cache = 0.0
|
||||
self._steer_cache = min(0.7, max(-0.7, self._steer_cache))
|
||||
|
|
Loading…
Reference in New Issue