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: 43e1409fd2
chrysler-long2
Kacper Rączy 1 year ago committed by GitHub
parent 597529cd6c
commit f10d6d5738
  1. 2
      tools/sim/bridge/common.py
  2. 4
      tools/sim/lib/keyboard_ctrl.py
  3. 2
      tools/sim/lib/manual_ctrl.py

@ -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()

Loading…
Cancel
Save