자율주행 데브코스 4기 TIL/ROS

Ubuntu18.04 docker 환경에서 ROS 설치

_yh47 2023. 4. 21. 14:43
Ubuntu 18.04 docker in Ubuntu 20.04

 

ROS 설치

(로컬 환경이신 분은 문서 그대로 따라치시면 됩니다.)

 

-Ubuntu18.04

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

 

melodic/Installation/Ubuntu - ROS Wiki

We are building Debian packages for several Ubuntu platforms, listed below. These packages are more efficient than source-based builds and are our preferred installation method for Ubuntu. Note that there are also packages available from Ubuntu upstream. P

wiki.ros.org

docker 환경이기 때문에 sudo 명령어는 꼭 빼주셔야 합니다.

(어차피 docker 환경에서 sudo 명령어를 치면 에러가 납니다.)

 

sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
apt install curl && curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
apt update
apt install ros-melodic-desktop-full
nano ~/.bashrc

bashrc 파일이 열리면 맨밑에 다음 명령어 추가

echo "source /opt/ros/melodic/setup.bash"

ctrl+x 누르고, y누르고, enter!

source ~/.bashrc
apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
apt install python-rosdep
rosdep init && rosdep update

하면 ros 설치 완료!

반응형