Windows 11에 설치된 WSL에 Ubuntu 18.04를 설치하고 여기에 ROS Melodic을 설치한다.
WSL 설치는 여기를 참조하면 된다.
WSL에 Ubuntu 18.04 설치
1. Microsoft Store에서 “ubuntu”를 검색한다.

2. “Ubuntu 18.04 LTS”를 선택하여 설치한다.

3. "Ubuntu 18.04"를 실행한다.

WSL에서 터미널 창 분할 사용
새로 열리는 창의 배포판을 미리 설정한다.


세로 창 열기: ALT + SHIFT + ‘+’ 키
가로 창 열기: ALT + SHIFT + ‘-’ 키
창간의 전환: ALT + 방향키
창 크기 조정: ALT + SHIFT + 방향키
창닫기: CTRL + SHIFT + ‘w’ 키
ROS Melodic 설치
sources.list 설정
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
키 설정
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
ROS 설치
sudo apt update
sudo apt install ros-melodic-desktop-full
환경 변수 설정
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
의존성 패키지들 설치
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
rosdep 초기화
sudo apt install python-rosdep
sudo rosdep init
rosdep update
catkin 설치
sudo apt install python-catkin-tools
mkdir -p catkin_ws/src
cd catkin_ws/
build
catkin init
catkin build
환경설정
echo "ROS1 activated"
source /opt/ros/melodic/setup.bash
source ~/catkin_ws/devel/setup.bash
test
terminal 1> roscore
terminal 2> rosrun turtlesim turtlesim_node
terminal 3> rosrun turtlesim turtle_teleop_key
RQT 테스트
terminal 1> roscore
terminal 2> rosrun turtlesim turtlesim_node
terminal 3> rqt
rqt 창: “Plugins” → “Topics” → “Message Publisher” → Topic에서 /turtle1/cmd_vel 선택, Type에서 geometry_msgs/Twist 선택 → 우측의 + 버튼 클릭 → linear(x축, y축)와 angular(z 축) 값 조정

참고
melodic/Installation/Ubuntu - ROS Wiki
We are building Debian packages for several Ubuntu platforms, listed below. These packages are more efficient than source-based builds and are our preferred installation method for Ubuntu. Note that there are also packages available from Ubuntu upstream. P
wiki.ros.org
[ROS1] ROS1 Melodic 설치
안녕하세요. 이번에는 ROS1 Melodic 버전의 설치를 이야기하려고 합니다. ROS는 이제 ROS2로 넘어가야하지만, 로봇의 특성상 많은 하드웨어들이 따라가야하기 때문에 분명 한동안 ROS1도 사용이 될겁
pinkwink.kr
'robotics > ROS' 카테고리의 다른 글
3DoF Manipulator의 URDF (0) | 2022.03.14 |
---|---|
URDF (0) | 2022.03.12 |
Raspberry Pi 4에 ROS 2 설치 (Install ROS 2 on Raspberry Pi 4) (0) | 2021.10.18 |
ROS2 on the Windows10 with WSL2 (0) | 2021.01.19 |
댓글