Donkey Car 官網 https://www.donkeycar.com/
Donkey Car文件 https://docs.donkeycar.com/
Donkey Car(Pi4版)向icshop購買 https://www.icshop.com.tw/product-page.php?27840
(1) 下載raspbian_lite_latest作業系統 https://downloads.raspberrypi.org/raspbian_lite_latest
(2)依此將印像檔安裝至mini sd card https://www.raspberrypi.org/documentation/computers/getting-started.html
sudo raspi-config //跟筆電要同一個wifi網段(建議用手機分享wifi熱點)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential python3 python3-dev python3-pip python3-virtualenv python3-numpy python3-picamera python3-pandas python3-rpi.gpio i2c-tools avahi-utils joystick libopenjp2-7-dev libtiff5-dev gfortran libatlas-base-dev libopenblas-dev libhdf5-serial-dev libgeos-dev git ntp
sudo apt-get install libilmbase-dev libopenexr-dev libgstreamer1.0-dev libjasper-dev libwebp-dev libatlas-base-dev libavcodec-dev libavformat-dev libswscale-dev libqtgui4 libqt4-test
python3 -m virtualenv -p python3 env --system-site-packages
echo "source env/bin/activate" >> ~/.bashrc
source ~/.bashrc
mkdir projects
cd projec
git clone https://github.com/autorope/donkeycar
cd donkeycar
git checkout master
pip install -e .[pi]
pip install numpy --upgrade
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=1DCfoSwlsdX9X4E3pLClE1z0fvw8tFESP" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=1DCfoSwlsdX9X4E3pLClE1z0fvw8tFESP" -o tensorflow-2.2.0-cp37-cp37m-linux_armv7l.whl
pip install tensorflow-2.2.0-cp37-cp37m-linux_armv7l.whl
sudo apt install python3-opencv
pip install opencv-python
git clone https://github.com/robocarstore/donkeycar-console
sudo mv donkeycar-console /opt
cd /opt/donkeycar-console
pip install -r requirements/production.txt
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
sudo ln -s gunicorn.service /etc/systemd/system/gunicorn.service
cd ~/mycar
python manage.py drive //如果要用遙桿控制改輸入 python manage.py drive --js
http://Raspberry Pi的ip:8887
space : stop car and stop recording
r : toggle recording
i : increase throttle
k : decrease throttle
j : turn left
l : turn right
python manage.py drive --js
Left analog stick - Left and right to adjust steering
Right analog stick - Forward to increase forward throttle
Pull back twice on right analog to reverse
Select button switches modes - "User, Local Angle, Local(angle and throttle)"
Triangle - Increase max throttle
X - Decrease max throttle
Circle - Toggle recording (disabled by default. auto record on throttle is enabled by default)
dpad up - Increase throttle scale
dpad down - Decrease throttle scale
dpad left - Increase steering scale
dpad right - Decrease steering scale
Start - Toggle constant throttle. Sets to max throttle (modified by X and Triangle).