ubuntu 18.04 ros-melodic install

hogeol·2022년 3월 5일
0

ROS

목록 보기
1/9

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

This post is written for ubuntu 18.04, ros-melodic
If your ubuntu version is 16.04, ros-version is kinetic
or your ubuntu version is 20.04, ros-version is noetic

  1. (Optional) If you want to install Opencv before install ros, following below link

https://velog.io/@korkhg15/Install-Opencv-3.4.0-on-Ubuntu-18.04

  1. Install curl

sudo apt install curl -y

  1. Setup sources.list

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

  1. Setup key

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

  1. Repository update (not necessary in 18.04)

sudo apt update

  1. Install ros-package (probably take long time)

sudo apt install -y ros-melodic-desktop-full

sudo apt install -y ros-melodic-rviz* ros-melodic-rqt*

  1. Environment setup (shell type bash or zsh)

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

or

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

  1. Install dependencies

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

  1. Initial rosdep (Don't be rosdep update as sudo)

sudo rosdep init

rosdep update

Optional settings from here, not necessary

  1. Init workspace (you should change workspace name 'catkin_ws' any other)

mkdir -p ~/catkin_ws/src

cd ~/catkin_ws/src

catkin_init_workspace

cd ~/catkin_ws && catkin_make

If you met error on catkin_make, see my ubuntu error series or find in google, or ask to my e-mail

  1. Shell settings

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

or

echo "source ~/catkin_ws/devel/setup.zsh" >> ~?.zshrc

  1. Export ros protocol

echo "export ROS_MASTER_URI=http://localhost:11311" >> ~/.bashrc

echo "export ROS_HOSTNAME=localhost" >> ~/.bashrc

or

echo "export ROS_MASTER_URI=http://localhost:11311" >> ~/.zshrc

echo "export ROS_HOSTNAME=localhost" >> ~/.zshrc

  1. Alias settings

gedit ~/.bash_aliases

alias cm='catkin_make'
alias cw='cd ~/catkin_ws'
alias cs='cd ~/catkin_ws/src'

save the file and leave

source ~/.bashrc

or

source ~/.zshrc

0개의 댓글