?Windows Docker運行GitHub - ZJU-FAST-Lab/Implicit-SVSDF-Planner: [SIGGRAPH 2024 & TOG]
?1. 設置環境
我將項目git clone在D:/Github目錄中。
下載ubuntu20.04 noetic鏡像
docker pull osrf/ros:noetic-desktop-full-focal
?啟動容器,掛載主機的D:/Github文件夾為/home,并將容器初始進入的路徑設為/home。
docker run -dit -v D:/Github:/home -w /home --name noetic osrf/ros:noetic-desktop-full-focal
進入容器并編譯項目:
docker exec -it noetic bash
source /opt/ros/noetic/setup.bash
cd Implicit-SVSDF-Planner/
./build.sh
報錯1:
root@18267cd27b32:/home/Implicit-SVSDF-Planner# ./build.sh bash: ./build.sh: /bin/bash^M: bad interpreter: No such file or directory
將win字符轉譯為unix
sed -i 's/\r$//' build.sh
報錯2:
Compilation failed due to link of gfortran. You should refer to https://askubuntu.com/questions/276892/cannot-find-lgfortran or use ubuntu20 instead
安裝包解決:
sudo apt update
sudo apt install gfortran
?編譯結束
2. 運行
source /opt/ros/noetic/setup.bash
cd Implicit-SVSDF-Planner/
source devel/setup.bash
export DISPLAY=host.docker.internal:0
roslaunch plan_manager run_sdTunnel.launch
使用VcXsrv可視化時出現了rviz的報錯,參考以下使用MobaXterm完成運行。
win10 下 wsl2 使用 rviz 報錯 Segmentation fault 段錯誤 (核心已轉儲) 的另一可能解決方案_rviz啟動報錯segmentation fault-CSDN博客
測試gpu但發現沒有區別的運行代碼:
docker run -dit -v D:/Github:/home -w /home --gpus all -e DISPLAY=host.docker.internal:0.0 -v /tmp/.X11-unix:/tmp/.X11-unix --network=host --privileged -it --name testrviz ros:noetic bash
?3. 保存鏡像
docker commit noetic my_new_image:latest