ROS는 버전에 따라서 호환되는 리눅스 OS가 다르다.
ROS Noetic - Ubuntu 20.04 LTS
ROS Melodic - Ubuntu 18.04 LTS
Noetic 설치했음.
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 -
sudo apt update && sudo apt upgrade
sudo apt install ros-noetic-desktop-full
source /opt/ros/noetic/setup.bash
roscore 실행해서 정상작동 확인하기
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo rosdep init
rosdep update
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws && catkin_make
source ~/catkin_ws/devel/setup.bash
gedit ~/.bashrc &
열린 .bashrc
파일에 가장 아래쪽에 아래 내용 복붙해서 저장
source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash
export ROS_HOSTNAME=localhost
export ROS_MASTER_URI=http://localhost:11311
alias cs='cd ~/catkin_ws/src'
alias cw='cd ~/catkin_ws'
alias cm='cd ~/catkin_ws && catkin_make'
alias sb='source ~/.bashrc'
source ~/.bashrc