LIFE LOG(ここにはあなたのブログ名)

あつあつ備忘録

ソフトやハード、時にはメカの備忘録をまとめていきます

【Ubuntu16.04】ROS環境構築

f:id:AtsuyaKoike:20190421152613p:plain
画像元

以下にROSの環境構築のコマンドを記述します。

$ sudo apt install git
$ git clone https://github.com/ryuichiueda/ros_setup_scripts_Ubuntu16.04_desktop
$ cd ros_setup_scripts_Ubuntu16.04_desktop/
$ ./step0.bash 
$ ./step1.bash 
$ source ~/.bashrc
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
$ source ~/.bashrc
$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
$ sudo apt-get update
$ sudo apt-get install ros-kinetic-desktop-full
$ sudo rosdep init
$ rosdep update
$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

最後、rebootしないと以下のコマンドを正常に実行できません。

$ reboot

$ roscore と打って以下のように表示されたら環境構築は終了です。

$ roscore
... logging to /home/atsuya/.ros/log/54354e3e-641d-11e9-98f5-08002716ba6e/roslaunch-atsuya-VirtualBox-1915.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://localhost:41625/
ros_comm version 1.12.14


SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES

auto-starting new master
process[master]: started with pid [1926]
ROS_MASTER_URI=http://localhost:11311/

setting /run_id to 54354e3e-641d-11e9-98f5-08002716ba6e
process[rosout-1]: started with pid [1939]
started core service [/rosout]