donkeycar icon indicating copy to clipboard operation
donkeycar copied to clipboard

1022 add programable buttons to webui

Open Ezward opened this issue 2 years ago • 2 comments

Issue https://github.com/autorope/donkeycar/issues/1022

This PR adds 5 general purpose buttons to the webui. Presses of these buttons can be processed by other donkeycar parts as input values.

  • reformatted webui layout into a 2 column layout that works better on a phone. This is in anticipation of using the phone while using an RC controller we we can get similar functionality to a game controller.
  • Also added code to hide the virtual joystick if it is not being used (if gamepad is being used).
  • Add 5 buttons to the ui
  • When a button is pressed the pressed state is sent to the donkeycar, which then latches the value.
  • The latched value is then written into vehicle memory.
  • Parts can detect button presses as input values and respond to them.

I've added code into the complete.py template that shows how to process the button presses. That is just there to test. Eventually we can decide if we want to add standard behavior to these buttons or add another mechanism for adding behaviors that can be configured.

This is what the webui looks like on a phone (sorry, github seems to be ignoring sizing and force width to fit) image

This is what it looks like on desktop image

Ezward avatar Jun 27 '22 05:06 Ezward

@Ezward - This is a great improvement, if we can use the web controller on the mobile phone. Can you please also update the version? You'll need to rebase, because I just merged the VESC PR.

DocGarbanzo avatar Jul 05 '22 20:07 DocGarbanzo

@DocGarbanzo Thank you for the review, I've rebased and updated version="4.3.20"

Ezward avatar Aug 05 '22 22:08 Ezward