ROS package를 받아올 주소를 sourcelist.d에 추가
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu\ $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
cat 명령으로 확인
jsg@jsg-ubuntu:~$ cat /etc/apt/sources.list.d/ros-latest.list deb http://packages.ros.org/ros/ubuntu xenial main
키는 바뀔 수 있으니 위 링크 참조
$ sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' \ --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
http://packages.ros.org/ros/ubuntu 에서 패키지 정보 최신화
$ sudo apt-get update
jsg@jsg-ubuntu:~$ sudo apt-get update ... 받기:5 http://packages.ros.org/ros/ubuntu xenial InRelease [4,678 B] ... 받기:10 http://packages.ros.org/ros/ubuntu xenial/main amd64 Packages [851 kB] 받기:11 http://packages.ros.org/ros/ubuntu xenial/main i386 Packages [621 kB] 내려받기 2,957 k바이트, 소요시간 2초 (1,303 k바이트/초) 패키지 목록을 읽는 중입니다... 완료
뭔가 겁나 많이 설치됨
$ sudo apt-get install -y ros-kinetic-desktop-full
의존성 패키지 정보 최신화
$ sudo rosdep init
$ rosdep update
bash 실행시 ROS실행에 필요한 환경변수들을 불러오도록
$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
jsg@jsg-ubuntu:~$ sudo apt install -y python-rosinstall \ python-rosinstall-generator python-wstool build-essential
$ roscore
명령을 실행하면 다음과 같이 나옴jsg@jsg-ubuntu:~$ roscore ... logging to /home/jsg/.ros/log/f771fcc6-4348-11eb-bd10-000c29ab1c70/roslaunch-jsg-ubuntu-37021.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://jsg-ubuntu:46689/ ros_comm version 1.12.17 SUMMARY ======== PARAMETERS * /rosdistro: kinetic * /rosversion: 1.12.17 NODES auto-starting new master process[master]: started with pid [37032] ROS_MASTER_URI=http://jsg-ubuntu:11311/ setting /run_id to f771fcc6-4348-11eb-bd10-000c29ab1c70 process[rosout-1]: started with pid [37045] started core service [/rosout]
jsg@jsg-ubuntu:~$ rosnode list /rosout