# Docker 安裝 ROS2 Jazzy > 2025-12-11 [TOC] --- ## IsaacSim-ros-workspaces ### 1. git clone 這份倉庫 :::info 🔗 **Repository:** [https://github.com/isaac-sim/IsaacSim-ros_workspaces](https://github.com/isaac-sim/IsaacSim-ros_workspaces) ::: ```bash git clone https://github.com/isaac-sim/IsaacSim-ros_workspaces.git ``` ### 2. 下載下來放在根目錄 `~/IsaacSim-ros_workspaces` ```bash cd ~/IsaacSim-ros_workspaces git submodule update --init --recursive ``` ### 3. 下載 `ROS2 Jazzy` image **x86_64:** ```bash xhost + docker run -it --rm --net=host --env="DISPLAY" --env="ROS_DOMAIN_ID" \ -v ~/IsaacSim-ros_workspaces/jazzy_ws:/jazzy_ws \ --name ros_ws_docker \ osrf/ros:jazzy-desktop \ /bin/bash ``` Aarch64 ```bash xhost + docker run -it --rm --net=host --env="DISPLAY" --env="ROS_DOMAIN_ID" -v ~/IsaacSim-ros_workspaces/jazzy_ws:/jazzy_ws --name ros_ws_docker arm64v8/ros:jazzy /bin/bash ``` ### 4. 設定 `FastDDS` ```bash export FASTRTPS_DEFAULT_PROFILES_FILE=~/IsaacSim-ros_workspaces/jazzy_ws/fastdds.xml ``` **(Optional)** 可以加上設定 ROS Domain ID (0-101): ```bash export ROS_DOMAIN_ID=30 ``` ### 5. Build `IsaacSim-ros-workspaces` :::warning ⚠️ **注意:這步最靠北** 編譯過程中可能會遇到依賴缺失的問題,請參考下方的解決方案。 ::: 執行編譯流程: ```bash cd jazzy_ws apt-get update git submodule update --init --recursive # If using docker, perform this step outside the container and relaunch the container rosdep install --from-paths src --ignore-src --rosdistro=$ROS_DISTRO -y source /opt/ros/jazzy/setup.sh colcon build source install/local_setup.bash ``` #### 🔧 故障排除:缺少套件 我本身有跳錯誤是因為沒有裝這些,請依序安裝: ```bash apt install ros-jazzy-vision-msgs apt-get install -y ros-jazzy-ackermann-msgs apt-get install -y ros-jazzy-moveit ros-jazzy-ros2-control ros-jazzy-ros2-controllers ``` #### ✅ 驗證 開一個新 terminal 驗證: ```bash docker exec -it ros_ws_docker /bin/bash -c 'source /opt/ros/jazzy/setup.bash; exec bash' ``` ### 6. 儲存容器狀態 (Commit) :::danger 🛑 **重要** 因為前面啟動時加了 `--rm`,關閉後 `apt` 安裝的套件可能會不見。 **務必開一個新terminal執行 Commit 儲存!** ::: 存成 `my_isaac_ros`: ```bash docker commit ros_ws_docker my_isaac_ros ``` 檢查有沒有存成功: ```bash docker images ``` 確認成功後,打這個離開容器: ```bash exit ``` --- ## 之後要打開 ### Terminal 1 (啟動容器) 注意:這裡使用的是剛剛 commit 出來的 `my_isaac_ros`。 ```bash docker run -it --rm \ --net=host \ --env="DISPLAY" \ --env="ROS_DOMAIN_ID" \ -v ~/IsaacSim-ros_workspaces/jazzy_ws:/jazzy_ws \ --name ros_ws_docker \ my_isaac_ros /bin/bash ``` :::info 💡 **路徑變更注意** **這裡改了!** 因為掛載路徑的關係: ::: ```bash export FASTRTPS_DEFAULT_PROFILES_FILE=/jazzy_ws/fastdds.xml ``` ### Terminal 2 (進入容器) ```bash docker exec -it ros_ws_docker /bin/bash -c 'source /opt/ros/jazzy/setup.bash; exec bash' ``` 同樣要注意環境變數路徑(因為在容器內,直接指向 `/jazzy_ws`): ```bash export FASTRTPS_DEFAULT_PROFILES_FILE=/jazzy_ws/fastdds.xml ``` 最後當然要 source 環境: ```bash source /opt/ros/jazzy/setup.bash source /jazzy_ws/install/local_setup.bash ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up