WSL2环境搭建Mujoco
mujoco包下载
mkdir ~/.mujoco
cd ~/.mujoco
wget https://www.roboti.us/download/mujoco200_linux.zip
unzip mujoco200_linux.zip
mv mujoco200_linux mujoco200
rm mujoco200_linux.zip
cp <location_of_mjkey.txt> .
- 注意:
mjkey.txt
在~/.mujoco
和~/.mujoco/mujoco200/bin
中均要添加
Ubuntu GUI环境的配置
sudo apt install libgl1-mesa-dev xorg-dev
sudo apt install libgl1-mesa-dev freeglut3-dev libglu1-mesa-dev
sudo apt install libsoil-dev libglm-dev libassimp-dev libglew-dev libglfw3-dev libxinerama-dev libxcursor-dev libxi-dev
Windows Xserver的配置
- 下载VcXsrv
- 点击后,配置
Display number=0
- 最后勾选首尾两个选项,最后一行填入
-ac
.bashrc
文件的配置
export LD_LIBRARY_PATH=~/.mujoco/mujoco200/bin${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export MUJOCO_KEY_PATH=~/.mujoco${MUJOCO_KEY_PATH}
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.0
export MESA_GL_VERSION_OVERRIDE=3.3
unset LIBGL_ALWAYS_INDIRECT
验证
sudo apt install x11-apps
xeyes
cd ./mujoco200/bin
./simulate ../model/humanoid.xml