ambf-rl理論上是架在ambf來跑reinforcement learning,但其實我裝起來,它並沒有呼叫ambf simulator,畫面看不到,top也沒看到有程序在跑,可能真的需要硬體. 為了裝這,我被迫改回Ubuntu 18.04版的.
因為需要一些其他的,網路又太慢,所以我改網路設定
sudo sed -i 's/tw.archive.ubuntu.com/archive.ubuntu.com/g' /etc/apt/source.list
Ubuntu 18.04一堆沒有,別懷疑
sudo apt install build-essential #Ubuntu 18.04一堆沒有
sudo apt install git
sudo apt install docker
sudo apt-get install ubuntu-restricted-extras
sudo apt-get install libasound2-dev
sudo apt-get install clang
sudo apt-get install htop
sudo apt-get install xorg-dev
sudo apt-get install python-cv-bridge
python3 -m pip install tomli
python -m pip install -U pip
pip install --upgrade setuptools
pip3 install --upgrade pip
ambf我是照ambf-rl網頁,不是新的ambf 2.0版
source /opt/ros/melodic/setup.bash
cd ~/
git clone --branch ambf-1.0-python3-fix https://github.com/DhruvKoolRajamani/ambf.git
cd ~/ambf
sudo apt-get -y -qq install --fix-missing $(cat install/apt-requirements.txt)
cat install/pip-requirements.txt | xargs -n 1 -L 1 pip install -U
mkdir build && cd build
cmake ../
make -j$(nproc)
然後裝ambf_rl
source ~/ambf/build/devel/setup.bash
cd ~/
git clone https://github.com/WPI-AIM/ambf_rl.git
cd ~/ambf_rl
cat install/training-pip-requirements.txt | xargs -n 1 -L 1 pip3 install -U
因為我沒有裝python venv,所以如果需要,可能要用網頁optional部份
mv ~/.local/lib/python3.6/site-packages/stable_baselines/ddpg/ddpg.py ~/.local/lib/python3.6/site-packages/stable_baselines/ddpg/ddpg_old.py
cp ~/ambf_rl/install/stable_baseline_fix/ddpg.py ~/.local/lib/python3.6/site-packages/stable_baselines/ddpg/
cd ~/ambf_rl
sudo python3 setup.py install #python3不是python
執行
cd ~/ambf_rl
source /opt/ros/melodic/setup.bash
source ~/ambf/build/devel/setup.bash
cd scripts/dVRK/
python main.py
啥事也沒發生