임베디드 | 라즈베리파이 | ARM | 리눅스 | Qt | 딥러닝

 

 

우선 리눅스를 설치해야한다.

VMware 설치 후 ubuntu ISO 다운로드 받아 설치

 

 

 

그리고 사이트에서 알려준데로 설정해준다

사이트링크 : https://docs.ros.org/en/kilted/Installation/Ubuntu-Install-Debs.html

 

Ubuntu (deb packages) — ROS 2 Documentation: Kilted documentation

Set up your environment by sourcing the following file. Note Replace .bash with your shell if you’re not using bash. Possible values are: setup.bash, setup.sh, setup.zsh.

docs.ros.org

 

시스템 설정

 - 지역설정 : UTF8 

locale  # check for UTF-8

$ sudo apt update && sudo apt install locales
$ sudo locale-gen en_US en_US.UTF-8
$ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
$ export LANG=en_US.UTF-8

$ locale  # verify settings

 

ROS2 저장소 추가 

https://github.com/ros-infrastructure/ros-apt-source/

 

GitHub - ros-infrastructure/ros-apt-source: Public keyring for ROS (Robot Operative System) archives

Public keyring for ROS (Robot Operative System) archives - ros-infrastructure/ros-apt-source

github.com

 

sudo apt install software-properties-common
$ sudo add-apt-repository universe

 

 

ROS2 패키지 설치

sudo apt update && sudo apt install curl -y
$ export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
$ curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" # If using Ubuntu derivates use $UBUNTU_CODENAME
$ sudo apt install /tmp/ros2-apt-source.deb

 

export > curl > sudo apt 세개를 순차적으로 해야한다

 

개발도구 설치

sudo apt update && sudo apt install ros-dev-tools

 

 

ROS2 설치

sudo apt install ros-kilted-desktop

 

ROS, RViz, demos, tutorials.

 

 

sudo apt install ros-kilted-ros-base

   Communication libraries, message packages, command line tools. No GUI tools.

 

 

환경설정source /opt/ros/kilted/setup.bash

 

 

예제 실행

source /opt/ros/kilted/setup.bash
$ ros2 run demo_nodes_cpp talker

 

 

 

다른 터미널에서 아래 명령어 실행 

source /opt/ros/kilted/setup.bash
$ ros2 run demo_nodes_py listener

 

 

talker와 listenr 가 서로 통신한다.