Skip to content

Instantly share code, notes, and snippets.

@tawnkramer
Last active April 10, 2020 07:42
Show Gist options
  • Save tawnkramer/6d244090cb8f2af1bc9f6d1ebc0377b1 to your computer and use it in GitHub Desktop.
Save tawnkramer/6d244090cb8f2af1bc9f6d1ebc0377b1 to your computer and use it in GitHub Desktop.
* linux ubuntu only now
Get donkeycar, if you don't have it. If you do, just checkout dev.
* cd ~/projects
* git clone https://github.com/autorope/donkeycar
* cd donkeycar
* git checkout master
Install conda. Optional but recommended
* wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
* bash ./Miniconda3-latest-Linux-x86_64.sh
Create a virtual env if you don't already have one
* conda env create -f install/envs/ubuntu.yml
Activate your virtual env
* conda activate donkey
Get donkeycar sim:
* with a web browser, download https://drive.google.com/file/d/10lpqOZ-dX9K9mJX4ggmrUM4FSnc-ZJLn/view?usp=sharing
* mv ~/Downloads/DonkeySimLinux.zip ~/
* cd ~/
* unzip DonkeySimLinux.zip
Get gym-donkeycar:
* cd ~/projects
* git clone https://github.com/tawnkramer/gym-donkeycar
* cd gym-donkeycar
* pip install -e .
Make a donkeycar and point at server:
* donkey createcar --path ~/sim_racer
* cd ~/sim_racer
* edit myconfig.py
* DONKEY_GYM = True
* DONKEY_SIM_PATH = "/home/$USER/DonkeySimLinux/donkey_sim.x86_64"
* DONKEY_GYM_ENV_NAME = "donkey-generated-track-v0" # ("donkey-generated-track-v0"|"donkey-generated-roads-v0"|"donkey-warehouse-v0"|"donkey-avc-sparkfun-v0")
* python manage.py drive
This should start the simulator process, attach to it, and give you controls depending on your config choices.
To configure the look of your car:
* GYM_CONF = { "body_style" : "donkey", "body_rgb" : (128, 128, 128), "car_name" : "me", "font_size" : 100}
The body style should be one of these: (donkey|bare|car01)
The body rgb is a tuple of three values, each 0-255
The car name will be displayed to help identify racers
The font size can be adjusted in case your name is long.
When racing in the virtual-racing-league online, change these settings in your myconfig.py:
DONKEY_SIM_PATH = "remote"
SIM_HOST = "trainmydonkey.com"
If you are not racing with donkey car code, you can start with the simple example file:
https://github.com/tawnkramer/sdsandbox/blob/tcpserver/src/test_client.py
@RyanC1681
Copy link

python test_client.py
File "test_client.py", line 7

^
SyntaxError: invalid syntax

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