Jetson Orin ROS2 설치

1. Jetson Orin에서 설치 가능한 ROS 2 버전

1.1 Ubuntu 20.04 (JetPack 5.x)

  • 설치 가능한 ROS 2 버전: Foxy, Galactic
  • Foxy는 LTS이지만 공식 지원이 종료됨
  • Galactic은 지원이 종료되었으며, 안정성을 고려하면 Foxy 추천
  • Humble은 공식 패키지로 지원되지 않으며, 소스 빌드 필요

1.2 Ubuntu 22.04 (JetPack 6.x)

  • 설치 가능한 ROS 2 버전: Humble, Iron
  • Humble은 LTS 버전이며 2027년까지 지원됨
  • Iron은 단기 지원 버전이며 2024년 11월에 지원 종료
  • Humble 사용을 추천

2. Ubuntu 20.04에서 ROS 2 Foxy 설치 방법

2.1 APT 패키지를 이용한 설치

2.1.1 패키지 목록 업데이트 및 필수 패키지 설치

sudo apt update && sudo apt upgrade -y
sudo apt install curl gnupg lsb-release -y

2.1.2 ROS 2 키 추가

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add -

2.1.3 패키지 저장소 추가

echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list

2.1.4 패키지 목록 업데이트 및 ROS 2 Foxy 설치

sudo apt update
sudo apt install ros-foxy-desktop -y

2.1.5 환경 변수 설정

echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
source ~/.bashrc

2.1.6 설치 확인

ros2 doctor

2.1.7 기본 테스트

  • talker 실행
    ros2 run demo_nodes_cpp talker
    
  • listener 실행 (다른 터미널에서)
    ros2 run demo_nodes_py listener
    

3. Ubuntu 20.04에서 ROS 2 Humble 설치 방법 (소스 빌드)

3.1 소스 빌드를 통한 설치

3.1.1 패키지 목록 업데이트 및 필수 패키지 설치

sudo apt update && sudo apt upgrade -y
sudo apt install -y python3-colcon-common-extensions python3-vcstool build-essential cmake git wget curl libpython3-dev python3-pip python3-rosdep lsb-release gnupg

3.1.2 ROS 2 소스 다운로드

mkdir -p ~/ros2_humble_ws/src
cd ~/ros2_humble_ws
git clone https://github.com/ros2/ros2.git -b humble src/ros2

3.1.3 의존성 설치

rosdep update
rosdep install --from-paths src --ignore-src -y

3.1.4 빌드 실행

colcon build --symlink-install

3.1.5 환경 변수 설정

echo "source ~/ros2_humble_ws/install/setup.bash" >> ~/.bashrc
source ~/.bashrc

3.1.6 설치 확인

ros2 doctor

4. Ubuntu 22.04에서 ROS 2 Humble 설치 방법

4.1 APT 패키지를 이용한 설치

4.1.1 패키지 목록 업데이트 및 필수 패키지 설치

sudo apt update && sudo apt upgrade -y
sudo apt install curl gnupg lsb-release -y

4.1.2 ROS 2 키 추가

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add -

4.1.3 패키지 저장소 추가

echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list

4.1.4 패키지 목록 업데이트 및 ROS 2 Humble 설치

sudo apt update
sudo apt install ros-humble-desktop -y

4.1.5 환경 변수 설정

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc

4.1.6 설치 확인

ros2 doctor

4.1.7 기본 테스트

  • talker 실행
    ros2 run demo_nodes_cpp talker
    
  • listener 실행 (다른 터미널에서)
    ros2 run demo_nodes_py listener
    

5. Ubuntu 22.04에서 ROS 2 Iron 설치 방법

5.1 APT 패키지를 이용한 설치

5.1.1 패키지 목록 업데이트 및 필수 패키지 설치

sudo apt update && sudo apt upgrade -y
sudo apt install curl gnupg lsb-release -y

5.1.2 ROS 2 키 추가

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add -

5.1.3 패키지 저장소 추가

echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list

5.1.4 패키지 목록 업데이트 및 ROS 2 Iron 설치

sudo apt update
sudo apt install ros-iron-desktop -y

5.1.5 환경 변수 설정

echo "source /opt/ros/iron/setup.bash" >> ~/.bashrc
source ~/.bashrc

5.1.6 설치 확인

ros2 doctor

5.1.7 기본 테스트

  • talker 실행
    ros2 run demo_nodes_cpp talker
    
  • listener 실행 (다른 터미널에서)
    ros2 run demo_nodes_py listener
    

6. 결론

6.1 Ubuntu 20.04

  • ROS 2 Foxy는 공식 APT 패키지를 통해 설치 가능
  • ROS 2 Humble을 설치하려면 소스 빌드 필요

6.2 Ubuntu 22.04

  • ROS 2 Humble 및 Iron을 APT를 통해 간편하게 설치 가능
  • 안정성을 고려하면 Ubuntu 22.04 + ROS 2 Humble 사용을 추천
  • 최신 기능이 필요하면 Ubuntu 22.04 + ROS 2 Iron 선택 가능