我们参照 https://gitee.com/caodev/mirror-RLBench/tree/master 镜像网站,阅读安装说明
首先配置环境变量,并安装CoppeliaSim ,如果无法下载 tar.xz 使用迅雷可解决。
一般不回遇到什么问题
# set env variables
export COPPELIASIM_ROOT=${HOME}/CoppeliaSim
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COPPELIASIM_ROOT
export QT_QPA_PLATFORM_PLUGIN_PATH=$COPPELIASIM_ROOT
wget https://downloads.coppeliarobotics.com/V4_1_0/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz
mkdir -p $COPPELIASIM_ROOT && tar -xf CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz -C $COPPELIASIM_ROOT --strip-components 1
rm -rf CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz
使用镜像 https://gitee.com/caodev/mirror-PyRep 解决卡顿问题
使用conda 创建 rlbench 环境,使用python3.8 这些库都比较老,不能用太新的python
conda create -n rlbench python=3.8.13
conda activate rlbench
进入项目目录,根据readme的指导开始安装 ,因为已经设置过环境变量,可以跳过,但是记得 source ~/.bashrc
安装步骤稍微有点曲折,注意:
pip3 install -r requirements.txt
pip3 install .
会有如下的报错,没问题的,继续安装
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
rlbench 1.2.0 requires Pillow, which is not installed.
rlbench 1.2.0 requires pyquaternion, which is not installed.
rlbench 1.2.0 requires scipy, which is not installed.
执行 pip install Pillow pyquaternion scipy 解决;
测试语句如下,如果能弹出来模拟器,则基本正常。
python3 examples/example_baxter_pick_and_pass.py
使用镜像网站安装,解决github慢的问题。 https://gitee.com/caodev/mirror-RLBench/tree/master
记得激活conda activate rlbench;source ~/.bashrc
git clone https://gitee.com/caodev/mirror-RLBench.git
然后进入项目目录,注销掉 setup的
# "pyrep @ git+https://github.com/stepjam/PyRep.git",
因为我们的 PyRep 是之前手动安装的,而且github不科学上网,基本拉不下来,重试很麻烦。
执行:pip install -e .
然后执行一句: pip install gymnasium==1.0.0a2
libGL error: MESA-LOADER: failed to open swrast: /home/cao/miniconda3/envs/rlbench/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/swrast_dri.so) (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
临时方案: export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
长久方案:conda install -c conda-forge libstdcxx-ng 或者
# 备份老库
mv ~/miniconda3/envs/rlbench/lib/libstdc++.so.6 ~/miniconda3/envs/rlbench/lib/libstdc++.so.6.bak
# 链接系统的
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ~/miniconda3/envs/rlbench/lib/libstdc++.so.6