with-RL
로봇 / ROS2024년 1월 26일

Windows에서 Docker를 이용해 ROS2, Gazebo 설치하기

이 포스트는 로봇 시뮬레이션을 위해서 ROD2와 Gazebo를 Docker를 이용해서 Windows에 설치하는 방법에 대한 설명입니다.

이 과정은 다음 환경에서 구성했습니다.

이 포스트는 다음 과정을 완료한 후에 참고하시길 바랍니다.

1. VcXsrv Windows X Server 설치하기

2. ROS2 설치

name: ros
services:
  ros2:
    image: osrf/ros:humble-desktop-full
    container_name: ros-ros2
    environment:
        DISPLAY: host.docker.internal:0.0
    ports:
        - “10000:10000”
    stdin_open: true
    tty: true
    entrypoint: /bin/bash
$ docker-compose -f .\ros.yml up
# echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
# exit
$ docker exec -it ros-ros2 /bin/bash
# ros2 run turtlesim turtlesim_node
$ docker exec -it ros-ros2 /bin/bash
# ros2 run turtlesim turtle_teleop_key

3. 관련 프로그램 및 Gazebo 설치하기

# apt update
# apt upgrade
# apt install -y git python3-pip
# apt install -y python3-colcon-common-extensions \
ros-humble-joint-state-publisher-gui \
ros-humble-gazebo-plugins \
ros-humble-joint-state-publisher \
ros-humble-gazebo-ros
# gazebo
Windows에서 Docker를 이용해 ROS2, Gazebo 설치하기 | with-RL