Skip to content

Instantly share code, notes, and snippets.

@tawnkramer
Last active September 12, 2017 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tawnkramer/8477071f176bf476f06db55a1d650580 to your computer and use it in GitHub Desktop.
Save tawnkramer/8477071f176bf476f06db55a1d650580 to your computer and use it in GitHub Desktop.

on your pi

wget https://raw.githubusercontent.com/tawnkramer/donkey/dev-mainline/donkeycar/parts/controllers/joystick.py
cp joystick.py ~/d2/

now edit ~/d2/manage.py

near the top, add a

import joystick

then comment out the local web controller, and add the line:

ctr = joystick.JoystickPilot(max_throttle=0.3)
#ctr = dk.parts.LocalWebController()

if this is too sensitive, try making max_throttle smaller. like 0.2 or 0.1

Update: The joystick part is integrated into donkey mainline now. No need to do this. Check docs for setup. https://github.com/wroscoe/donkey/tree/master/docs

@dlarue
Copy link

dlarue commented Aug 21, 2017

on the standard donkey platform, 30% was a bit too fast for me so I tried 20% but it was too slow and even stopped on a bump. 25% was juuuuust right.

@jacksilb
Copy link

jacksilb commented Sep 2, 2017

Tawn, how do we pair the PS3 controller with the RPI3 in the first place so then we can use your code ;-)?

Thank you,
-Jack

Well, here is what found that it seems what I need.
https://www.piborg.org/blog/pi-zero-wifi-ps3
https://www.piborg.org/rpi-ps3-help

@jacksilb
Copy link

jacksilb commented Sep 3, 2017

Tawn, the wget is not working. Did you change the file locations by any chance?

HTTP request sent, awaiting response... 404 Not Found
2017-09-02 18:23:50 ERROR 404: Not Found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment