ROSã¨ã¯ï¼
ãRobot Operating Systemã®ç¥ã§ããOperating Systermã¨ãã£ã¦ãå®ã¯OSã§ã¯ç¡ãã¦ãLinux(Ubuntu)ä¸ã§åãããã«ã¦ã§ã¢ã§ããã¢ã¡ãªã«çºã®ããã«ã¦ã§ã¢ã§ãç¾å¨ã®ããããã®ç 究ã»éçºã§ã¯ããã¡ã¯ãã¹ã¿ã³ãã¼ãã«ãªã£ã¦ããOSSï¼ãªã¼ãã³ã½ã¼ã¹ã½ããã¦ã§ã¢ï¼ã§ãã
ããã®åãDARPAã¨ãããããã競æä¼ã§æ¥æ¬ã10ä½ã«ãªã£ã¦ãã¾ã£ãã¨è©±é¡ã«ãªãã¾ããããå®ã¯ãã®ç«¶æä¼ã®ããããã®å¤§åã«ä½¿ããã¦ããããã«ã¦ã§ã¢ãROSã§ããDARPAã§ä½¿ããã¦ããã½ããã¦ã§ã¢ããçµæ§OSSã¨ãã¦Webä¸ã«å
¬éããã¦ããããã¾ããæ¥æ¬ã®ãããããROSã使ã£ã¦ãã¾ããã
ãå¾ã¯ããã¨ã¿ãããæè¿HSR(Human Support Robot)ã¨ãããããããä½ã£ã¦ãã¾ããããã¡ãã«ãå®ã¯ROSã使ããã¦ããããã¾ãã
ãROSã®è¯ãç¹ã¯ã½ããã¦ã§ã¢ã®åå©ç¨ãããããã¨ãä¸çä¸ã®äººãè²ã ãªããã¤ã¹ï¼ã«ã¡ã©ã»ã»ã³ãµã»ããããï¼ã®ããã¤ã¹ãã©ã¤ããã½ãã使ã£ã¦ããã¨ããã¨ãã·ãã¥ã¬ã¼ã·ã§ã³(Gazebo)ãç»åå¦çã©ã¤ãã©ãª(Open CV)ã¨é£æºããããçè²ã ããã¿ãããªã®ã§ã以åRaspberry Piã§ä½ã£ããããããROSã§åãããã«ãã¦è²ã 試ãã¦ã¿ããããªã¨æãã¾ãã
ãåèæ¸ã¯ä»¥ä¸ã®æ¬ã§ããä»ã®æå¯ä¸ã®æ¥æ¬èªã§æ¸ãããROSã®æ¸ç±ã§ãã
- ä½è : å°åå´
- åºç社/ã¡ã¼ã«ã¼: å·¥å¦ç¤¾
- çºå£²æ¥: 2015/06/25
- ã¡ãã£ã¢: åè¡æ¬
- ãã®ååãå«ãããã° (4件) ãè¦ã
ã以ä¸ã¯ROSã«èå³ãªã人ã¯å
¨ãæå³ã®ãªãå
容ãç¶ãã®ã§ãããã¾ã§èªãã§ã¾ã èå³ãããã¨ãã人ã ãç¶ããèªããã¯ãªãã¯ãã ããã
Raspberry Pi 2ã«ROSãã¤ã³ã¹ãã¼ã«ããæ¹æ³
ãROSã¯Ubuntuä¸ã§åãã®ã§Ubuntuãã¤ã³ã¹ãã¼ã«ããPCã«ã¤ã³ã¹ãã¼ã«ããã®ãé常ãªã®ã§ãããUbuntuãåãã¾ã¨ããªPCãç¡ãã£ãã®ã¨ã以åä½ã£ããããããRaspberry Piã§åãã®ã§Raspberry Piã«ã¤ã³ã¹ãã¼ã«ã«ãã£ã¬ã³ã¸ãã¦ã¿ã¾ãã
å¿ è¦ãªãã®
ãæä½éã¯ä»¥ä¸ãããã
- åºç社/ã¡ã¼ã«ã¼: RaspberryPi.org
- ã¡ãã£ã¢: ã¨ã¬ã¯ãããã¯ã¹
- ãã®ååãå«ãããã° (10件) ãè¦ã
- åºç社/ã¡ã¼ã«ã¼: ãããã¡ãã¼
- çºå£²æ¥: 2011/07/30
- ã¡ãã£ã¢: Personal Computers
- è³¼å ¥: 198人 ã¯ãªãã¯: 5,602å
- ãã®ååãå«ãããã°ãè¦ã
ããã¨ã¯ä»¥ä¸ãåèã«é©å½ã«è³¼å ¥ãã ããã
ROSãã¤ã³ã¹ãã¼ã«ãããRaspberry Pi 2ç¨Ubuntuããã¦ã³ãã¼ã
ãæ£æ»æ³ã§ã¤ã³ã¹ãã¼ã«ãããªããROSããã«ãããããªãã¨ãããªãã®ã§ãããæ°æé以ä¸ããããããã®ã§ã失æãããç«ã¡ç´ãã¾ããããããªè»å¼±ãªç§ã®ãããªäººã®ããã«ãRaspberry Pi 2ç¨ã«ROSãã¤ã³ã¹ãã¼ã«ããUbuntuã®ã¤ã¡ã¼ã¸ãã¡ã¤ã«ãå ¬éãã¦ããä»ã®ãããªäººããã¾ããã以ä¸ã®ãµã¤ããããã¦ã³ãã¼ãã
http://www.mauriliodicicco.com/raspberry-pi2-ros-images/
ãtar.gzã§åºãã¦ããã®ã§ãé©å½ã«è§£åãã¦ãã ãããMacãªãã¿ã¼ããã«èµ·åãã¦ããã¦ã³ãã¼ããããã¡ã¤ã«(ubuntu_arm_ros.tar.gz)ãæ ¼ç´ãããã©ã«ãã¾ã§ç§»åãã¦ã以ä¸ã³ãã³ãã§è§£åã
$ tar xvzf ubuntu_arm_ros.tar.gz
ãaristoteles.img
ã¨ããæ´è½ãååã®å·¨å¤§(15GB)ãªã¤ã¡ã¼ã¸ãã¡ã¤ã«ãåºã¦ãã¾ããæåä½åº¦ãã£ã¦ã解åã§ããªãã£ãã®ã§ããããã½ã³ã³ã®ç©ºã容éããªãã¨ããã¨ã»ã»ãªãªãã§ããâ¦
ãã£ã¹ã¯ã®ãã©ã¼ããã
ã次ã«ROSãã¤ã³ã¹ãã¼ã«ããSDããã©ã¼ããããã¾ãããã好ããªæ¹æ³ã§ããã§ããã確å®ãªã®ã¯SD Formatterã使ãæ¹æ³ã§ãã以ä¸ã®ãµã¤ããããã¦ã³ãã¼ãããSD Formatterã使ã£ã¦SDã«ã¼ãããã©ã¼ãããããã¾ãããããã©ã¤ããé¸æããã ãã®ç°¡åè¨è¨ã
ãã£ã¹ã¯ã®ããã¤ã¹ãã¡ã¤ã«ã確èª
ãMacã§ã³ãã¼ãããSDã«ã¼ããæ¿å ¥å¾ã«dfã³ãã³ãå®è¡ãã¦SDã«ã¼ãã®ããã¤ã¹ãã¡ã¤ã«ã確èªãããããããªããã°ãæ¿å ¥åã¨æ¿å ¥å¾ã§dfã³ãã³ãå®è¡ãã¦æ¯è¼ãã¾ãããã
$ df
ãæ¿å
¥å¾ã«å¢ãã¦ããããã¤ã¹ãã¡ã¤ã«ãSDã«ã¼ãã®ããã¤ã¹ãã¡ã¤ã«ã§ããä¾ãã°/dev/disk2
ã¨ã/dev/disk3
ã¨ãã
ã¤ã¡ã¼ã¸æ¸ãè¾¼ã¿
ãæ¸ãè¾¼ã¿ãããSDã«ã¼ããæ¿å ¥ãã¦ã以ä¸ã®ã³ãã³ãã§ã¢ã³ãã¦ã³ã
$ diskutil umountDisk /dev/disk2
ãä¾ãã°ããã¥ã¡ã³ããã©ã«ãç´ä¸ã«ã¤ã¡ã¼ã¸ãã¡ã¤ã«ãç½®ããå ´åã¯ä»¥ä¸ã®ã³ãã³ãã§æ¸ãè¾¼ã¿ã§ãã¾ãã/dev/disk2ã®å ´å㯠/dev/rdisk2ã®ããã«rãã¤ããã®ããã¤ã³ããçç±ã¯â¦ããããããªãã§ãããã¿ã¾ããããªãã§ããã¢ã³ãããã¡ã¢ã¼ãã«ãªã£ã¦é度ãéããªãã¿ããã§ããbs=1mã¯ä¸åº¦ã«æ¸ãè¾¼ã容éã表ãã¦ãã¦1m(1MB)ãããã«ããªãã¨ããã¾ãé度ãé
ããªãã¾ãï¼2015/10/12ä¿®æ£ï¼ã
$ sudo dd if=Documents/aristoteles.img of=/dev/rdisk2 bs=1m
ããã°ããï¼æ°åï¼å¾
ã¤ã¨å®äºã®ã¡ãã»ã¼ã¸ãåºãã®ã§ãæ¸ãè¾¼ã¿å®äºãéä¸çµéãæ°ã«ãªãæ¹ã¯Ctrl+T
ã§é²æã表示ã§ãã¾ãããã¨ã¯ä»¥ä¸ã®ã³ãã³ãã§ã¢ã³ãã¦ã³ããã¦ããSDã«ã¼ããåãåºãã¾ãããã
$ diskutil eject /dev/disk2
Raspberry Pi 2ã§ROSèµ·åã»ã»ããã¢ãã
ãæ©éèµ·åãã¦ã»ããã¢ãããã¦ã¿ã¾ããããRaspberry Pi 2ã«ã¤ã¡ã¼ã¸ãã¡ã¤ã«æ¸ãè¾¼ãã SDãããã¦èµ·åããã ãã§ããããã©ã«ãã®ã¦ã¼ã¶åã¨ãã¹ã¯ã¼ãã¯ubuntu
ã§ãã
æ¥æ¬èªãã¼ãã¼ãè¨å®
ãç¥ã¤ã¡ã¼ã¸ãç¨æãã¦ãã ãã£ããããªãªããã¯é½æ°ï¼å¤åï¼ãªã¤ã¿ãªã¢äººã§ããã¼ãã¼ããã¤ã¿ãªã¢è¨å®ã«ãªã£ã¦ããã®ã§ãæ¥æ¬èªè¨å®ã«ãã©ãã¾ãã以ä¸ã®ã³ãã³ãã§æ¥æ¬èªè¨å®ãã¾ãããã
$ sudo dpkg-reconfigure keyboard-configuration
ã大ä½ä»¥ä¸ã®è¨å®ã§ãã¾ãããã¨æãã¾ãã
Generic 105-key (Intl) PC â Japanese â Japanese â The default for the keyboard layout â No compose key
SDã«ã¼ã容éæ¡å¼µ
ãSDã«ã¼ã16GB以ä¸ã®å®¹éã使ã£ã¦ããå ´åã§ãã16GBã®ã¤ã¡ã¼ã¸ã®ãã16GBã¾ã§ãã使ãã¾ããããã®ã¾ã¾ã§ã¯ãã£ãããªããåããåºã¦ãã¾ãã®ã§ã使ã£ã¦ãªãSDã®å®¹éã使ããããã«ãã¦ããã¾ãããã以ä¸ã®ã³ãã³ãããã¤ã¨/mnt/sd
ã¨ãããã£ã¬ã¯ããªã«SDã®æ®ã容éããã¦ã³ãããã¾ããä¸æãããã¨ãã¼ã¿ãå
¨ã¦å¹ã£é£ã¶ã®ã§æ
éã«ãCUIã®fdisk使ãæ¹æ³ã¨GUIã®gparted使ãæ¹æ³ã®2ã¤ã説æãã¾ããfdiskã使ãã®ã¯ç·ãããã§ããããªã¹ã¹ã¡ã¯gpartedãæä½ãGUIã§ç´æçã§ããããã¼ãã£ã·ã§ã³ã®çµåãã§ãã¾ãã
fdiskã使ãæ¹æ³
$ sudo fdisk /dev/mmcblk0
Command (m for help): n
次ã«Command (m for help):
ãåºã¦ããã¾ã§ã¨ã³ã¿ã¼é£æï¼ããã©ã«ãè¨å®ï¼
Command (m for help): w
ããã§ãã¼ãã£ã·ã§ã³å²ãå½ã¦ãããã®ã§ä¸æ¦åèµ·å
$ sudo shutdown -r now
ã以ä¸ã³ãã³ãã§é åããã©ã¼ããã
$ sudo mkfs.ext4 /dev/mmcblk0p3
$ sudo mkdir /mnt/sd
ããã¦ã³ãã®ãã¹ã
$ sudo mount /dev/mmcblk0p3 /mnt/sd
ããã¦ã³ãããããã確èª
$ df
ã/dev/mmcblk0p3
ã/mnt/sd
ã«ãã¦ã³ãããã¦ãããOKã以ä¸ã§ã¢ã³ãã¦ã³ã
$ sudo umount /mnt/sd
èµ·åæã«ãã¦ã³ãããããã«ä»¥ä¸ã³ãã³ãã§/etc/fstab
ãç·¨é
$ sudo vi /etc/fstab
æ«å°¾ã«ä»¥ä¸è¿½è¨
/dev/mmcblk0p3 /mnt/sd ext4 defaults,noatime 0 2
åèµ·å
$ sudo shutdown -r now
ãããã§/mnt/sd
ã«æ®ãã®SD容éããã¦ã³ãããã¾ãã æ®ã容éãå°ãªããªã£ã¦ããã/mnt/sd
ã使ç¨ãã¾ããã
gpartedã使ãæ¹æ³
ãgpartedã使ãã¨GUIã§ãã¼ãã£ã·ã§ã³å¤æ´ã§ããã®ã§ä½¿ããããããããã¾ããã以ä¸ãµã¤ããé常ã«ããããããã§ããfdiskã§ã¯ã§ããªãããã¼ãã£ã·ã§ã³ãçµåãã¦ã大ããªãã¼ãã£ã·ã§ã³ãã¤ãããã¨ãã§ãã¾ãã
WiFiè¨å®
ãWiFiè¨å®ãæç·LANã§ãããã£ã¦äººã¯ç¡è¦ãã¦ããã§ããã©ãèªå¾ã§åããããããªãå¿ é ãã¨æãã¾ããã¡ãªã¿ã«èªåã使ãã®ã¯ä»¥ä¸ã®USB-WiFiã¢ã¸ã¥ã¼ã«ãå°åãªã®ã¨Ubuntuã§èªèã§ããå®ç¸¾ãããã®ã§æªããªãããªã¨æãã¾ããçµæ§ç±ããªããã©ã
- åºç社/ã¡ã¼ã«ã¼: ãããã¡ãã¼
- çºå£²æ¥: 2011/07/30
- ã¡ãã£ã¢: Personal Computers
- è³¼å ¥: 198人 ã¯ãªãã¯: 5,602å
- ãã®ååãå«ãããã°ãè¦ã
ãã¨ããããRaspbianã®è¦é ã§WiFiè¨å®ãããç¹ãããªãã®ã§ããããã®åèãµã¤ããå ã«èª¿æ»ã
ã以ä¸ã³ãã³ãã§USB-WiFiãèªèãã¦ããããã§ãã¯ã
$ iwconfig
wlan1ã§USB-WiFiã¯èªèãã¦ããããªãã¨ãããã
ãããã¨æå¹ã«ãããã¨ä»¥ä¸ã³ãã³ããã¤ã¨
$ sudo ifconfig wlan1 up
ãSIOCSIFFLAGS: Operation not possible due to RF-kill
ã¨ããã¨ã©ã¼çºçã調ã¹ããWiFiã¢ã¸ã¥ã¼ã«ã«ãããã¯ãããã£ã¦ããã¨çºçããã¨ã©ã¼ãããã¨ããå¤ãæ¹ã¯ä»¥ä¸ã
$ rfkill list
0: phy0: Wireless LAN Soft blocked: yes Hard blocked: no
ã½ããçã«ãããã¯ããã¦ãããããã以ä¸ã®ã³ãã³ãã§å¤ã
$ sudo rfkill unblock wifi
ãããã¯ãå¤ãããã¨ã確èª
$ rfkill list
0: phy0: Wireless LAN Soft blocked: no Hard blocked: no
以ä¸ã³ãã³ããç¡äºWiFiãç«ã¡ä¸ããï¼ã¯ãï¼
$ sudo ifconfig wlan1 up
ãã¹ãã¨ãã¦ã以ä¸ã³ãã³ãã§å¨å²ã®ã¢ã¯ã»ã¹ãã¤ã³ããããããã§ã¦ãããOK
$ sudo iwlist wlan1 scanning
ãã®ã¾ã¾ã ã¨èµ·åãããæ¯årfkillããªãã¨ãããªãã®ã§ã以ä¸ã§èªåçã«èµ·åããããã«ãã
$ sudo vi /etc/rc.local
以ä¸ã追è¨
rfkill unblock wifi
ãã¨ã¯/etc/network/interfaces
ã以ä¸ã³ãã³ãã§viã§ç·¨é
$ sudo vi /etc/network/interfaces
ã以ä¸ã®éãã
# The loopback network interface auto lo iface lo inet loopback iface eth0 inet dhcp # The primary network interface allow-hotplug wlan1 iface wlan1 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
ã次ã«/etc/wpa_supplicant/wpa_supplicant.conf
ã以ä¸ã³ãã³ãã§ç·¨é
$ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
ãä¸èº«ã¯ä»¥ä¸ãssidã¨ãã¹ã¯ã¼ããå ¥åãã¦ãã ããã
network={ ssid="MyNetwork" psk="MyPassPhrase" }
ã以ä¸ã³ãã³ãã§åèµ·å
$ sudo shutdown -r now
ãããã§ãããã«ã¤ãªãããã¯ãã
Ubuntu(+ROS)ã«ã½ããã¤ã³ã¹ãã¼ã«
ãROS使ãã®ã«ä¾¿å©ã ã£ããããã½ããã®ã¤ã³ã¹ãã¼ã«ãROSé¢ä¿ã¯ä¸éãã¤ã³ã¹ãã¼ã«ããã¦ããã®ã§ããã®ä»ã®ãã¼ã«ãªã©ãéæ追å ä¸ã
FireFox
ãããã©ã«ãã®ãã©ã¦ã¶ã¯æ¥æ¬èªè¡¨ç¤ºã§ããªãã£ãã®ã§ãã¨ããããfirefoxå ¥ãã¦ã¿ããã¹ãã
ã¤ã³ã¹ãã¼ã«
$ sudo apt-get update $ sudo apt-get install firefox
以ä¸ã³ãã³ãã§èµ·å
$ firefox
ãèªåã®ãµã¤ãè¦ãããä¸å¿æ¥æ¬èªè¡¨ç¤ºããã¾ããã
ã¹ã¯ãªã¼ã³ã·ã§ããã½ãã(shutter)
ã以ä¸ã§shutterã¨ããã¢ããªãã¤ã³ã¹ãã¼ã«ã
$ sudo apt-get update $ sudo apt-get install shutter
ã以ä¸ã³ãã³ãã§èµ·å
$ shutter
ãçµæ§èµ·åã¾ã§é ãã®ã§ãã¾ãã¡ããã
ã¿ã¼ããã«ã½ãã(terminator)
ãã¦ã£ã³ãã¦ãåå²ã§ããã¿ã¼ããã«ãROSã§ã¯è¤æ°ã®ããã»ã¹ãèµ°ãããå¿ è¦ãããã®ã§ä¾¿å©ã
$ sudo apt-get update $ sudo apt-get install terminator
X Windowè¨å®
ã以ä¸ã³ãã³ãã§XWindowç«ã¡ä¸ã
$ startx
ã以ä¸ã®ãããªããããç»é¢ãç«ã¡ä¸ããã¾ããã¨ããããã®ããªãªããã®ããã©è¨å®è¶ ã¯ã¼ã«ãªã®ã§ã©ããã£ã¦ããã®ãæãã¦æ¬²ããã
ãå³ã¯ãªãã¯âTerminalã§ã¿ã¼ããã«ãç«ã¡ä¸ããã¾ã
ããã¼ãã¼ãè¨å®ãã¾ãå ã«æ»ã£ã¦ãã¾ãã®ã§ã以ä¸ã³ãã³ãã§ä¿®æ£ãã¤ãã§ã«Capsãã¼ãCtrlãã¼ã¨ãã¦ä½¿ããããã«è¨å®ãã¦ãã¾ãï¼ä¸è¦ãªã -option ctrl:nocapsãåé¤ãï¼
$ setxkbmap -model jp106 -layout jp -option ctrl:nocaps
ãæ¯åä¸è¨ã³ãã³ãããã¤ã®ãé¢åãªã®ã§.bashrc
ã«ã³ãã³ãè¨è¼ãã¦èªåå
$ vi ~/.bashrc
æ«å°¾ã«ä»¥ä¸ã追å ã
setxkbmap -model jp106 -layout jp -option ctrl:nocaps
ãåèµ·åãã¦startx
ããã°åæ ãããã¯ããããåæ ããããã£ãã以ä¸ã³ãã³ãã
$ source ~/.bashrc
ãããã¯ã¼ã¯è¨å®
ãã¨ãããã以ä¸ã®è¨å®ãããªãã¨åããªãã§ãã詳ãã説æã¯çç¥ãã¾ãããã¿ã¾ããã
以ä¸ã®ãã¡ã¤ã«ãç·¨é
$ sudo vi ~/conf/ros_master_uri
以ä¸ã®è¡ã追è¨
export ROS_MASTER_URI=http://localhost:11311
ã.bashrc
ãç·¨é
$ vi ~/.bashrc
以ä¸è¿½è¨
source /opt/ros/indigo/setup.bash â source ~/ros/devel/setup.bash
ã¿ã¼ããã«åèµ·åãã¿ã¼ããã«åèµ·åã®ä»£ããã«ä»¥ä¸ã³ãã³ãã§ãOK
$ source ~/.bashrc
以ä¸ã³ãã³ãå®è¡
$ export
以ä¸ã表示ããã¦ããã°OK
ROS_MASTER_URI="http://localhost:11311"
ROSåä½ãã§ãã¯
ãããããåä½ãã§ãã¯ã§ãã
ã·ãã¥ã¬ã¼ã¿èµ·å
ã以ä¸ã³ãã³ãå®è¡
$ roscore
ãªã«ãããããã表示ããã¦æ¢ã¾ã£ã¦ãã¾ãã®ã§ããã®ã¦ã£ã³ãã¦ã¯ãã®ã¾ã¾ã«ãã¦ãå¥ã¦ã£ã³ãã¦ãéãä¸è¨ã³ãã³ãå®è¡
$ rosrun turtlesim turtlesim_node
ã«ã¡ããã®ã·ãã¥ã¬ã¼ã¿ãèµ°ãã°ã¨ããããOK
ã¾ã¨ãã¨ä»å¾ã®äºå®
ãRaspberry Pi2ã«ROSãå ¥ãã¦ã¿ãã®ã§ãããæ£ç´ROSã¯ããªãé£æ度ãé«ãã®ã¨ãRaspberry Pi2ã ã¨ãã·ã³ã¹ããã¯ã足ããã§ããªããã¨ãå¤ãã®ã§ã©ããããããªã¨ããã¨ããã§ããããã¤ããã¿ã¯ããã®ã§ãå°ãã ããã©ã¤ãã¦æ§åè¦ãã¦ã¿ããããªã¨æãã¾ãã
追è¨ï¼2016/07/01ï¼
Linux(Ubuntu) PCã«ãROSã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ãããèå³ããæ¹ã¯ãã¡ããã©ããã
åèãµã¤ã
ãå大ãªå 人ãã¡ã«å©ãããã£ã±ãªãã§ããç§ã®è¨äºãæªããå ´åã¯ä»¥ä¸ã®ãµã¤ããè¦ã«è¡ãã®ãããã¨æãã¾ãã