mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 16:26:14 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user