metadrive: fix wasd steer signs (#30623)

* Swap AD signs

* Fix type annotation

* fix user torque

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
old-commit-hash: 43e1409fd2fa4a92350a54434602b71b1874fd60
This commit is contained in:
Kacper Rączy
2023-12-12 14:09:07 -08:00
committed by GitHub
parent 597529cd6c
commit f10d6d5738
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ Ignition: {self.simulator_state.ignition} Engaged: {self.simulator_state.is_enga
self.simulator_state.user_brake = brake_manual
self.simulator_state.user_gas = throttle_manual
self.simulator_state.user_torque = steer_manual * 10000
self.simulator_state.user_torque = steer_manual * -10000
steer_manual = steer_manual * -40
+2 -2
View File
@@ -62,11 +62,11 @@ def keyboard_poll_thread(q: 'Queue[str]'):
elif c == 'w':
q.put("throttle_%f" % 1.0)
elif c == 'a':
q.put("steer_%f" % 0.15)
q.put("steer_%f" % -0.15)
elif c == 's':
q.put("brake_%f" % 1.0)
elif c == 'd':
q.put("steer_%f" % -0.15)
q.put("steer_%f" % 0.15)
elif c == 'z':
q.put("blinker_left")
elif c == 'x':
+1 -1
View File
@@ -183,6 +183,6 @@ def wheel_poll_thread(q: 'Queue[str]') -> NoReturn:
if __name__ == '__main__':
from multiprocessing import Process, Queue
q: Queue[str] = Queue()
q: 'Queue[str]' = Queue()
p = Process(target=wheel_poll_thread, args=(q,))
p.start()