donkeycar: Not able to use a physical joystick along with web server
I’m not able to use my physical joystick with web server, but it works fine when I use the “–js” option, but that disables the web server, according to the docs: “The default web controller may be replaced with a one line change to use a physical joystick part for input …”, where is this line, and how do I change it?
Temporarily fix: go to manage.py and changes:
if use_joystick or cfg.USE_JOYSTICK_AS_DEFAULT:
ctr = JoystickController(max_throttle=cfg.JOYSTICK_MAX_THROTTLE,
steering_scale=cfg.JOYSTICK_STEERING_SCALE,
auto_record_on_throttle=cfg.AUTO_RECORD_ON_ THROTTLE)
else:
# This web controller will create a web server that is capable
# of managing steering, throttle, and modes, and more.
ctr = LocalWebController(use_chaos=use_chaos)
V.add(ctr,
inputs=['cam/image_array'],
outputs=['user/angle', 'user/throttle', 'user/mode', 'recording'],
threaded=True)
to:
ctr = LocalWebController(use_chaos=use_chaos)
V.add(ctr,
inputs=['cam/image_array'],
outputs=['user/angle', 'user/throttle', 'user/mode', 'recording'],
threaded=True)
ctr = JoystickController(max_throttle=cfg.JOYSTICK_MAX_THROTTLE,
steering_scale=cfg.JOYSTICK_STEERING_SCALE,
auto_record_on_throttle=cfg.AUTO_RECORD_ON_ THROTTLE)
V.add(ctr,
inputs=['cam/image_array'],
outputs=['user/angle', 'user/throttle', 'user/mode', 'recording'],
threaded=True)
In that way you add the two controller handlers, but the JoystickController needs to be the last. This is a temporally fix, not a bug fix!
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (7 by maintainers)
That doesn’t work with 2.5 and above, only with 2.4
@huberemanuel I missunderstood, sorry. That indeed sucks.
@huberemanuel What does ‘…disables the Webserver.’ mean? Does it say ‘device /dev/jd0’ not found? or what?