Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

what i learned

[ROS2] VMware에서 Ubuntu 22.04 설치 후 ROS2 Humble 실행 (Mac m1) 본문

ROS

[ROS2] VMware에서 Ubuntu 22.04 설치 후 ROS2 Humble 실행 (Mac m1)

햄식이111 2024. 1. 23. 01:33

Ubuntu 22.04는 아래 링크에서 다운받을 수 있다.

https://ubuntu.com/download/server

ARM과 AMD가 다르다는 것을 유의하고 다운받자! (mac에는 arm이 호환된다)

 

나의 경우엔 VMware에 이미 Ubuntu 18.04 버전 하나가 구동되고 있어서,

VMWare의 File > New... 를 들어가서 가상환경을 하나 더 생성했다.

 

이후 Done을 누르며 설치를 진행하면 Ubuntu 22.04 설치가 완료되지만 server 만 설치한 것이기 때문에 Desktop으로 변경해준다.

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ubuntu-desktop
$ sudo reboot

이 과정까지 완료하면 22.04의 마스코트(?) 해파리를 볼 수 있다.

상단 우측의 favorite bar에 있는 아이콘은 terminator 이다.

우분투에 기본 터미널이 있지만 사용하기 더 편해서 추가로 설치해주었다.

$ sudo apt install terminator

 

 

이제 ROS2 Humble을 설치한다.

$ sudo apt install software-properties-common
$ sudo add-apt-repository universe
$ sudo apt update && sudo apt install curl -y
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ros-humble-desktop
$ sudo apt install ros-dev-tools
$ source /opt/ros/humble/setup.bash

추가로,  $ source /opt/ros/humble/setup.bash를 터미널 열 때마다 매번 해주기 귀찮으므로

bash 파일에 넣어주었다.

$ gedit ~/.bashrc

# 맨 밑에 줄에 아래의 코드 작성
source /opt/ros/humble/setup.bash

~/.bashrc 파일

 

이후 아래의 명령어를 실행해서 ros2 publisher가 되는지 확인하면 끝난다.

$ ros2 run demo_nodes_cpp talker


[참고링크]

[Tistory] vmware fusion - Ubuntu 22.04

[askUbuntu] Install Ubuntu Desktop

[Tistory] 현직자가 알려주는 ROS2 Humble 설치방법