프로그램 설치 및 환경설정/IOT

[ROS / Jetson Nano] Jetson Nano ROS 설치

LiaLi_1997 2023. 5. 6. 17:01

1. Jetson Nano 에 Ubuntu 설치하기

Jetson Nano 에 Ubuntu 설치는 아래 링크에 설명해 두었으니 참고하라

https://jeahun10717.tistory.com/65

 

[IOT / Jetson Nano] jetson 나노 초기화 밑 ubuntu 설치

졸업작품을 IOT 기기를 활용하는 프로젝트를 하게 되어서 ubuntu 설치를 정리한다. IOT : Jetson Nano Labtop : Macbook Pro(m1) NVIDIA Jetson Nano OS 설치하기 Jetson Nano 는 기본 메모리 디스크가 없기 때문에, 별도

jeahun10717.tistory.com

 


2. Jetson Nano 에 ROS-melodic 설치

ROS melodic 설치는 아래 링크를 참고하여 진행하면 된다. 하지만 간략하게 아래에 정리를 해 두겠다.

http://wiki.ros.org/melodic/Installation/Ubuntu

2.1. Configure your Ubuntu repositories

ubuntu 에서 "restricted," "universe,", "multiverse." 설치 가능하게 변경하여야 한다.

관련 자료는 아래 링크 참고

https://help.ubuntu.com/community/Repositories/Ubuntu

 

Repositories/Ubuntu - Community Help Wiki

What are Repositories? There are literally thousands of Ubuntu programs available to meet the needs of Ubuntu users. Many of these programs are stored in software archives commonly referred to as repositories. Repositories make it easy to install new softw

help.ubuntu.com

 

2.2. Setup source list(source 리스트 셋팅)

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

 

2.3. Set up your keys(key 셋팅)

$ sudo apt install curl
$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

 

2.4. Installation(melodic 설치)

# apt update
$ sudo apt update
# ros-melodic 설치
$ sudo apt install ros-melodic-desktop-full
# melodic 설치 확인
$ apt search ros-melodic

# 필자는 대부분의 ros 기능을 사용해야 해서 full 을 받았으나 
# 아래 링크 참고하여 본인이 필요한 것만 받아도 된다
# http://wiki.ros.org/melodic/Installation/Ubuntu

2.5. Environment setup(환경변수 설정)

Ros 설치가 끝났으면 ROS 실행을 위하여 환경변수를 편집해 주어야 한다.

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

만약 현재 열려있는 해당 터미널에서만 동작하게 하려면 위의 명령어를 생략하고 아래 명령어를 실행하면 된다.

$ source /opt/ros/melodic/setup.bash

만약 bash shell 이 아닌 zsh 환경이라면 아래 명령어를 입력하면 된다.

$ echo "source /opt/ros/melodic/setup.zsh" >> ~/.zshrc
$ source ~/.zshrc

 

2.6. Dependencies for building packages(의존성 패키지 설치)

ROS 의존 패키지(python-rosdep, python-rosinstall 등) 을 설치한다.

필자는 python3 에서 작업을 진행해야 했어서 이 작업을 진행했다.

$ sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential

의존성 패키지 설치가 끝났으면 아래 명령어로 rosdep 초기화를 진행한다.

$ sudo rosdep init
$ rosdep update

 

2.7. ROS 설치 확인 및 기본명령어 실행

ROS 설치가 끝났다면 아래 명령어를 쳐 보자.

$ roscd
$ rostopic list

rostopic list 를 쳤을 때 오류가 발생한다면 아래 명령어를 친 이후 쳐 보자.

$ roscore

참고 화면

위의 화면처럼 명령어가 먹히면 ROS 가 정상적으로 설치된 것이다.