[0350]_motion_streamer_からgopigo3設定★

1.
2.
3.
4.
5.
6.MJPG-streamer のインストール

Raspberry Pi 2 のカメラを motion から MJPG-streamer に変更

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install subversion libjpeg-dev imagemagick
svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer
cd mjpg-streamer
make
sudo make install

sudo service motion stop
./mjpg_streamer -i “./input_uvc.so -y” -o “./output_http.so -w ./www”
cd ~
mkdir tool
——–
vi ./stream.sh
——–
#!/bin/sh

# This is Web-streaming server start up script.for raspi
# No warrantly.

# Config
PORT=”8081″
ID=”ベーシック認証のID” # 適宜変更してください
PW=”ベーシック認証のパスワード” # 適宜変更してください
SIZE=”640×480″ # 320×240でも良いです
F_RATE=”15″ # 5 fps なので 1秒5コマです。
MJPG_STREAMER=/usr/local/bin/mjpg_streamer

export LD_LIBRARY_PATH=/usr/local/lib
$MJPG_STREAMER \
-i “input_uvc.so -f $F_RATE -r $SIZE -d /dev/video0 -y” \
-o “output_http.so -w /usr/local/www -p $PORT -c $ID:$PW” -b
——–
動作確認
★★★★★★★★★★★★★★★
★画像起動★
sh /home/pi/tool/stream.sh
★★★★★★★★★★★★★★★
——–
シェル・スクリプト追加<★まだ未設定★>
sudo vi /etc/rc.local
——–
# MJPG Streamer Start
sh /home/pi/tool/stream.sh<★まだ未設定★>
——–
★★★★★★★★★★★★★★★
★画像はここで映る★
http://192.168.0.14:8081/stream.html
★★★★★★★★★★★★★★★

7.gopigo3のサンプルDL

git clone https://github.com/DexterInd/GoPiGo3.git
cd /home/pi/GoPiGo3/Projects/RemoteCameraRobot
sudo chmod +x install.sh
sudo ./install.sh
★★★★★★★★★★★★★★★
★GoPiGo3を動かす★
cd /home/pi/GoPiGo3/Projects/RemoteCameraRobot
python3 flask_server.py
★★★★★★★★★★★★★★★
★GoPiGo3はここで動きを操作★
http://192.168.0.14:5000
★★★★★★★★★★★★★★★

[0349]_wget_python_camara_web_code


https://pypi.python.org/pypi/webcam-streamer/1.0.5
参考

wget https://pypi.python.org/packages/e3/15/a8d672659efd50beb8efee371cf493688c1c096a1900b0d33c3c176a051d/webcam-streamer-1.0.5.tar.gz#md5=8a8913493a29a9f3a61e50171f0df9ce

解凍
tar -zxvf xxxx.tar.gz
より
tar -zxvf webcam-streamer-1.0.5.tar.gz

pip install webcam-streamer

OpenCV 3.3.0インストール
wget https://github.com/opencv/opencv/archive/3.3.0.tar.gz
解凍
tar -zxvf xxxx.tar.gz
より
tar -zxvf 3.3.0.tar.gz

pip install webcam-streamer

http://dex.local:5000/
で見れるか?(ダメだった、、エラー)

■python-v4l2captureをインストール
https://github.com/gebart/python-v4l2capture
参考
git clone https://github.com/gebart/python-v4l2capture.git

python-v4l2captureで
To build and install:
./setup.py install
やったけど、、

Example
=======
See capture_picture.py, capture_picture_delayed.py and list_devices.py.
(ダメだった、、エラー)

■Ubuntuのページでやってみる
https://codezine.jp/article/detail/10068
参考

ワークスペースは、一応
/home/pi/GoPiGo3/Projects/RemoteCameraRobot
にする!!

パッケージのインストール
$ sudo apt-get update
$ sudo apt-get install ros-indigo-rosbridge-suite ros-indigo-roswww ros-indigo-libuvc-camera ros-indigo-web-video-server
$ rospack profile
(これは、roscoreと一緒に動かすやつなのでダメだわ・・)


wget http://videocapture.sourceforge.net/VideoCapture-0.9-5.zip

unzip VideoCapture-0.9-5.zip

https://stackoverflow.com/questions/44372490/installing-opencv-3-2-0-on-raspberrypi-3
参考
sudo apt-get install python-opencv

https://pypi.python.org/pypi/webcam-streamer/1.0.5
も引き続き参考
手順
Obtain a USB webcam
Find an internet-connected device with a USB port
Plug the webcam into the USB port
Install OpenCV
pip install webcam-streamer
webcam-streamer
(はい、エラー・・・・ OpenCVが無い???とな?)

■10/23
OpenCVのインストール、10/23

Install guide: Raspberry Pi 3 + Raspbian Jessie + OpenCV 3

How to install OpenCV 3 on Raspbian Jessie


参考

Step #1: Install dependencies
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo rpi-update
$ sudo reboot
$ sudo apt-get install build-essential git cmake pkg-config
$ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
$ sudo apt-get install libxvidcore-dev libx264-dev
$ sudo apt-get install libgtk2.0-dev
$ sudo apt-get install libatlas-base-dev gfortran
$ sudo apt-get install python2.7-dev python3-dev

Step #2: Grab the OpenCV source code
$ cd ~
$ wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.0.0.zip
$ unzip opencv.zip
$ wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.0.0.zip
$ unzip opencv_contrib.zip

Step #3: Setup Python
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py
$ sudo pip install virtualenv virtualenvwrapper
$ sudo rm -rf ~/.cache/pip

vi ~/.profile

# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

$ source ~/.profile
$ mkvirtualenv cv
$ mkvirtualenv cv -p python3

$ source ~/.profile
$ workon cv
$ pip install numpy

Step #4: Compile and install OpenCV
$ workon cv
$ cd ~/opencv-3.0.0/
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.0.0/modules \
-D BUILD_EXAMPLES=ON ..

==============

— Python 2:
— Interpreter: /home/pi/.virtualenvs/cv/bin/python2.7 (ver 3.4.2)
— Libraries: /usr/lib/arm-linux-gnueabihf/libpython3.4m.so (ver 3.4.2)
— numpy: /home/pi/.virtualenvs/cv/local/lib/python3.4/site-packages/numpy/core/include (ver 1.13.3)
— packages path: lib/python3.4/site-packages

— Python 3:
— Interpreter: /home/pi/.virtualenvs/cv/bin/python3.4 (ver 3.4.2)
— Libraries: /usr/lib/arm-linux-gnueabihf/libpython3.4m.so (ver 3.4.2)
— numpy: /home/pi/.virtualenvs/cv/local/lib/python3.4/site-packages/numpy/core/include (ver 1.13.3)
— packages path: lib/python3.4/site-packages

==============

$ make -j4

[100%] Building CXX object samples/cpp/CMakeFiles/tutorial_copyMakeBorder_demo.dir/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp.o
[100%] Linking CXX executable ../../bin/cpp-tutorial-Sobel_Demo
[100%] Linking CXX executable ../../bin/cpp-tutorial-copyMakeBorder_demo
[100%] Linking CXX executable ../../bin/cpp-tutorial-calcBackProject_Demo1
[100%] Built target tutorial_Sobel_Demo
[100%] Built target tutorial_copyMakeBorder_demo
[100%] Built target tutorial_calcBackProject_Demo1
<<<<<<<<<<<<ここmでOK!!!!>>>>>>>>>>>>

$ make clean
$ make

$ sudo make install
$ sudo ldconfig

Step #5: Finishing the install

For Python 2.7:
$ ls -l /usr/local/lib/python2.7/site-packages/
total 1636
-rw-r–r– 1 root staff 1675144 Oct 17 15:25 cv2.so

$ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/
$ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so

For Python 3:
$ ls /usr/local/lib/python3.4/site-packages/
cv2.cpython-34m.so

$ cd /usr/local/lib/python3.4/site-packages/
$ sudo mv cv2.cpython-34m.so cv2.so

$ cd ~/.virtualenvs/cv/lib/python3.4/site-packages/
$ ln -s /usr/local/lib/python3.4/site-packages/cv2.so cv2.so

Step #6: Verifying your OpenCV 3 install
$ workon cv
$ python
>>> import cv2
>>> cv2.__version__
‘3.0.0’

■10/24再度トライ!!××××××
/home/pi/GoPiGo3/Projects/MouseControl
sudo chmod +x mouse_control_robot.py
sudo ./mouse_control_robot.py
(ダメ!マウスの言う事きかない・・・・)

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
■10/24再度トライ!!◎◎◎△△△★
/home/pi/GoPiGo3/Projects/RemoteCameraRobot
python3 flask_server.py
`http://dex.local:5000`

・・・動いたけど、映像出ないなあ・・・・・
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
sudo bash install.sh
してみる・・・
(ダメ!映像出ない・・・・)

sudo pip install webcam-streamer
(これ、時間かかる・・・風呂はいろ・・・・)
workon cv

webcam-streamer
(ダメ!映像出ない・・・・)

■Webカメラ、インストール

参考
sudo apt install fswebcam
(ダメ!映像出ない・・・・)


参考
$ sudo apt-get install guvcview
(ダメ!映像出ない・・・・)
$ guvcview &


http://blog.goo.ne.jp/roboz80/e/16ea5be9a9eaf370046035be841b4bfd
参考
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install guvcview
(ダメ!映像出ない・・・・)


http://blogs.itmedia.co.jp/narisako/2014/09/post.html
参考
sudo apt-get install motion
MOTION の設定をする。 
/etc/motion にある motion.conf をエディタで直接変更

on を off に変更する
webcam_localhost off
control_localhost off

カメラのリアルタイム映像を見ることができた?????
http:// (IPアドレス) :8081/
http:// 192.168.0.9:8081/

Raspberry Pi に Webカメラ


参考
sudo vi /etc/motion/motion.conf

「stream_auth_method」 を 「1」にして

(8081ポートはBasic認証がかかっているので、

という風に書きます。)

なので、
sudo motion
http://pi:robots1234@192.168.0.9:8081
(ダメ!映像出ない・・・・)

Raspberry Pi 2 のカメラを motion から MJPG-streamer に変更


参考
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install subversion libjpeg-dev imagemagick
svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer
cd mjpg-streamer
make
sudo make install

MJPG-streamer の起動
sudo service motion stop
cd mjpg-streamer
./mjpg_streamer -i “./input_uvc.so” -o “./output_http.so -w ./www”
./mjpg_streamer -i “./input_uvc.so -y” -o “./output_http.so -w ./www”

./mjpg_streamer -i “./input_uvc.so -y -r 640×480 -f 15” -o “./output_http.so -p 8081 -w ./www -c ID:PASSWORD” -b
より
./mjpg_streamer -i “./input_uvc.so -y -r 640×480 -f 15” -o “./output_http.so -p 8081 -w ./www -c pi:robots1234” -b
./mjpg_streamer -i “./input_uvc.so -y -r 640×480 -f 15” -o “./output_http.so -p 8081 -w ./www -c root:Aa123456” -b
/dev/video0 is owned by root video (check with ls -l /dev/video0),
なので、

https://stackoverflow.com/questions/35450089/error-opening-v4l-interface-operation-not-permitted
参考
sudo usermod -aG video pi

/etc/modules-load.d/raspberrypi.conf

snd-bcm2835
i2c-dev
bcm2835-v42l2
(ダメ!映像出ない・・・・)


https://github.com/RetroMelon/Raspberry-Pi-Car/issues/1
参考
sudo apt-get install libjpeg8-dev imagemagick libv4l-dev
(ダメ!映像出ない・・・・)


https://miguelmota.com/blog/raspberry-pi-camera-board-video-streaming/
参考
sudo apt-get install libv4l-dev
sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h

sudo mkdir /opt/mjpg-streamer
cd /opt/mjpg-streamer/

sudo apt-get install libjpeg8-dev
sudo apt-get install imagemagick
sudo apt-get install subversion

sudo svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/ .
sudo make

http://:9000/
http://192.168.09.9:9000
(ダメ!映像出ない・・・・)

■(10/25)

Raspberry Pi 2 のカメラを motion から MJPG-streamer に変更


参考

<<MJPG-streamer のインストール>>
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install subversion libjpeg-dev imagemagick

sudo svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer
cd mjpg-streamer
make
sudo make install

<<MJPG-streamer の起動>>
sudo service motion stop
★★★★★★★★★★★★★★★★★★★★★
cd /home/pi/mjpg-streamer
./mjpg_streamer -i “./input_uvc.so -y” -o “./output_http.so -w ./www”
★★★★★★★★★★★★★★★★★★★★★
(ダメ!映像出ない・・・・)

■(10/25)

Raspberry Pi – Webcam streaming


参考
# apt-get install fswebcam
$ fswebcam -r 640×480 -S 15 –flip h –jpeg 95 –shadow –title “SLB Labs” –subtitle “Home” –info “Monitor: Active @ 1 fpm” –save home.jpg -q -l 60
(ダメ!映像出ない・・・・)

■(10/25)
https://bbs.nextthing.co/t/mjpeg-streamer-with-compatible-usb-webcam/6505
参考
sudo apt-get update
sudo apt-get install uvcdynctrl
sudo apt-get install build-essential subversion libjpeg62-turbo-dev
sudo apt-get install imagemagick libv4l-0 libv4l-dev
sudo svn co https://svn.code.sf.net/p/mjpg-streamer/code mjpg-streamer
cd mjpg-streamer
make USE_LIBV4L2=true clean all
sudo make install
(ダメ!映像出ない・・・・)

■(10/25)
https://github.com/RetroMelon/Raspberry-Pi-Car/issues/1
参考
sudo apt-get install libjpeg8-dev imagemagick libv4l-dev
(ダメ!映像出ない・・・・)

■252_RaspberryPi_監視カメラstreamerのraspberrypi間移行★
■226_RaspberryPi監視カメラ1?OK・・・
(ダメ!映像出ない・・・・)

■(10/26)
cd /home/pi/mjpg-streamer
./mjpg_streamer -i “./input_uvc.so -y” -o “./output_http.so -w ./www”
(ダメ!映像出ない・・・・)

■(10/27)
cd /home/pi/mjpg-streamer
sudo ./mjpg_streamer
./mjpg_streamer -i “./input_uvc.so -y -r 640×480 -f 15” -o “./output_http.so -p 8081 -w ./www -c pi:robots1234” -b
./mjpg_streamer -i “./input_uvc.so -y -r 640×480 -f 15” -o “./output_http.so -p 8081 -w ./www -c root:Aa123456” -b
./mjpg_streamer -i “-c pi:robots1234” -b

■<Webで簡単操作のやつ>OKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOKOK
cd /home/pi/GoPiGo3/Projects/RemoteCameraRobot
python3 flask_server.py

Webで
http://192.168.0.12:5000
にアクセス


cd /opt/mjpg-streamer/

sudo make

http://:9000/
http://192.168.09.9:9000
(ダメ!映像出ない・・・・)

■(10/28)RaspberryPi Subversion install やり直してみる
http://d.hatena.ne.jp/mirans/20121209/1355022718
参考
(subvernsionを入れなおしたけどダメ・・・)

[0348]_github_download方法

★★★★★★★★★★★
githubのgopigoのExampleをダウンロードする
★★★★★★★★★★★

参考

Exampleのありか
https://github.com/DexterInd/GoPiGo/tree/master/Software/Python
Exampleのありか
https://github.com/DexterInd/GoPiGo/tree/master/Software/Python/Examples
★★★★★★★★★★★
https://github.com/DexterInd/GoPiGo3/tree/master/Software/Python/Examples
★★★★★★★★★★★

見本文は
git clone git@github.com:everydayrails/rails-4-1-rspec-3-0.git
より
ありかのWebは
https://github.com/DexterInd/GoPiGo
https://github.com/DexterInd/GoPiGo3.git
なので、cloneのありかは、
git clone https://github.com/DexterInd/GoPiGo.git
★★★★★★★★★★★
git clone https://github.com/DexterInd/GoPiGo3.git
★★★★★★★★★★★
だから
コマンドは、
★★★★★★★★★★★
git clone https://github.com/DexterInd/GoPiGo.git
git clone https://github.com/DexterInd/GoPiGo3.git
★★★★★★★★★★★
(うまくコピーできた!!!)

cd /home/pi/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot

pi@dex:~/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot $ pwd
/home/pi/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot

pi@dex:~/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot $ ls -l
合計 228
-rw-r–r– 1 pi pi 485 10月 18 21:03 COPYING
-rw-r–r– 1 pi pi 1498 10月 18 21:03 LICENSE
-rw-r–r– 1 pi pi 2598 10月 18 21:03 README.md
-rw-r–r– 1 pi pi 62402 10月 18 21:03 Raspberry_Pi_Camera_controlled-by-mobile-browser.jpg
-rw-r–r– 1 pi pi 56971 10月 18 21:03 Raspberry_Pi_Camera_streaming-to-computer-browser.jpg
-rw-r–r– 1 pi pi 58138 10月 18 21:03 Raspberry_Pi_Camera_streaming-to-mobile-browser.jpg
-rwxr-xr-x 1 pi pi 2792 10月 18 21:03 browser_stream_setup.sh
-rw-r–r– 1 pi pi 5178 10月 18 21:03 camera_streamer.py
-rwxr-xr-x 1 pi pi 6377 10月 18 21:03 robot_controller.py
-rwxr-xr-x 1 pi pi 10613 10月 18 21:03 robot_web_server.py
drwxr-xr-x 5 pi pi 4096 10月 18 21:03 www

でも、操作が分からない、、、ので
★★★★★★
(美人だな)レイチェルさんのWebページを参照!

Raspberry Pi: Robot Camera Car Controlled Through the Browser


★★★★★★

Clone their repository from GitHub
git clone https://github.com/DexterInd/GoPiGo.git

cd GoPiGo

cd Setup
sudo chmod +x install.sh
sudo ./install.sh

★★★★★★★★★★★
Testing
★★★★★★★★★★★
cd GoPiGo/Software/Python
sudo python basic_test_all.py
(あれ?。だめだな動かないや!!助けてレイチェルさん!)

★★★★★★★★★★★
Browser Streaming
★★★★★★★★★★★gopigo
cd /home/pi/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot
sudo chmod +x browser_stream_setup.sh
sudo chmod +x robot_web_server.py
sudo ./browser_stream_setup.sh

cd /home/pi/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot
sudo ./robot_web_server.py

http://192.168.0.2
http://192.168.0.7:1
(うーーーーん?。まだだめだな動かないや!!レイチェルさん!)

★★★★★★★★★★★gopigo3
cd /home/pi/GoPiGo3/Software/Python/Examples
sudo chmod +x Motor.py
sudo chmod +x Remote_Control.py

sudo ./Motor.py
sudo ./Remote_Control.py
(これは動く、gopigo3のExamplesのままなので。)
★★★★★★★★★★★

http://192.168.0.6:9090
http://192.168.0.6:8085
http://192.168.0.6:8080
http://192.168.0.6 dex -I
http://192.168.0.6
いろいろやったが、だめ。。。。
レイチェルさん!助けて・・・・・

viエディタでshファイルに追加
import gopigo3
import easygopigo3
(・・・したけど、だめ。)

10/22、更に

Python in the GoPiGo3


参考
sudo curl -kL dexterindustries.com/update_gopigo3 | bash
sudo reboot

■××××××
/home/pi/GoPiGo3/Projects/MouseControl
sudo chmod +x mouse_control_robot.py
sudo ./mouse_control_robot.py
(ダメ!マウスの言う事きかない・・・・)

■◎◎◎◎◎
/home/pi/GoPiGo3/Projects/BasicRobotControl
sudo chmod +x keyboarded_robot.py
sudo chmod +x run_this.py
sudo ./run_this.py
(◎これはOK!!)

■◎◎◎◎◎
/home/pi/GoPiGo3/Projects/IntelligentObjectAvoider
robot.py
sudo chmod +x robot.py
python3 robot.py
(◎動いたが、、servoがいうこと角を検知して避けるようだが。言うこと聞かないなあ・・・)

■×××××RaspPiCameraでないとダメみたい・・・
/home/pi/GoPiGo3/Projects/RemoteCameraRobot
python3 flask_server.py

<以下は、RemoteCameraRobotの説明文、フォルダ内のREADME.mdより>
# Remote Controlled GoPiGo3

In this project we remotely control a GoPiGo3 robot via a mobile device or a laptop.
![Imgur](http://i.imgur.com/sT2tHuPl.jpg)
## Requirements
We need the following components for this project:

* A [GoPiGo3](https://www.dexterindustries.com/gopigo3/) robot – it also includes the battery pack.
* A [Raspberry Pi](https://www.dexterindustries.com/raspberry-pi/).
* A [Pi Camera](https://www.dexterindustries.com/shop/raspberry-pi-camera/).
* A laptop or a mobile device (aka smartphone).

## Setting Up

In order to proceed the setup, make sure you have the `GoPiGo3` repository installed (not just cloned, but also installed) or that you have the latest version of `Raspbian For Robots`.
After going through the above paragraph, install the `Pi Camera` dependencies and `Flask` by running the `install.sh` script:
“`
sudo bash install.sh(★これやった:マーク★)
“`
If everything goes well, **reboot** your `Raspberry Pi`.(★これやった:マーク★)
You should now have everything set up.

## Running it

Start the server by typing the following command:
“`
python3 flask_server.py(★これやった:マーク★)
“`
It’s going to take a couple of seconds for the server to fire up.
A port and address will be shown in there. By default, the port is set to `5000`.

http://dex.local:5000(★これやった:マーク★)でも、RaspPiCameraの映像待ち、、、そりゃそっか・・・

If you have got `Raspbian For Robots` installed, then going to `http://dex.local:5000` address will be enough.
If you don’t have `Raspbian For Robots`, then you’ll need to see what’s your interface’s IP address.

Also, please make sure you have your mobile device / laptop on the same network as your `GoPiGo3`. Otherwise, you won’t be able to access it.

## YouTube Video

#### When loading `http://dex.local:5000` for the first time, click a couple of times on the screen without moving the mouse around, in order to enable the “joystick” functionality.

Here’s a YouTube video of this project:

[![Alt text](https://img.youtube.com/vi/Tu_-Al6Smhg/0.jpg)](https://www.youtube.com/watch?v=Tu_-Al6Smhg)

[0347]_python_Example

tar -zxvf xxxx.tar.gz

tar -zxvf gopigo3-1.1.1.tar.gz

sudo python basic_robot.py

sudo python Motor.py

tar -zxvf gopigo3-test1-0.0.3.tar.gz

pi@raspberrypi:~/GoPiGo/Software/Python/gopigo3-1.1.1/Examples $ python LED.py
Traceback (most recent call last):
File “LED.py”, line 20, in
GPG = gopigo3.GoPiGo3() # Create an instance of the GoPiGo3 class. GPG will be the GoPiGo3 object.
File “build/bdist.linux-armv7l/egg/gopigo3.py”, line 232, in __init__
gopigo3.FirmwareVersionError: GoPiGo3 firmware needs to be version 0.3.x but is currently version 0.2.6

10/13 Fri
gopigo3 1.1.1
https://pypi.python.org/pypi/gopigo3/1.1.1

GoPiGo3 Tutorials & Documentation

Raspbian for Robots Support Page

Raspbian for Robots Support

Raspberry Pi Robot Software

Raspbian For Robots Update

Install Raspbian for Robots on an SD Card for the Raspberry Pi

Install Raspbian for Robots on an SD Card for the Raspberry Pi


>>>
Enter the?password:?robots1234

Five Ways To Run a Program On Your Raspberry Pi At Startup

Five Ways To Run a Program On Your Raspberry Pi At Startup

10/14 Sat
Our Software: Raspbian for Robots

Raspberry Pi Robot Software

Join GitHub today for Dexter
https://github.com/DexterInd/GoPiGo

GoPiGo3/Software/Python/
https://github.com/DexterInd/GoPiGo3/tree/master/Software/Python/Examples

>>>Five Ways To Run a Program On Your Raspberry Pi At Startup

Five Ways To Run a Program On Your Raspberry Pi At Startup

error happened >>>>

pi@dex:~/gopigo3-1.1.1/Examples $ python Motor.py
Traceback (most recent call last):
File “Motor.py”, line 20, in
GPG = gopigo3.GoPiGo3() # Create an instance of the GoPiGo3 class. GPG will be the GoPiGo3 object.
File “/usr/local/lib/python2.7/dist-packages/gopigo3-1.1.1-py2.7.egg/gopigo3.py”, line 232, in __init__
gopigo3.FirmwareVersionError: GoPiGo3 firmware needs to be version 0.3.x but is currently version 0.2.6

answer>>>
https://forum.dexterindustries.com/t/update-the-firmware-on-the-gopigo3/3256
https://forum.dexterindustries.com/t/update-the-firmware-on-the-gopigo3/3256/2

The Desktop – You can click on the Software Update icon, update it if you haven’t updated in the last few months, and then select your robot and update the firmware.

>>>Example

Python Projects

>>>

Python in the GoPiGo3


sudo curl -kL dexterindustries.com/update_gopigo3 | bash
sudo reboot

>>>Examples in Dexter’s Raspbian OS
/home/pi/Dexter/GoPiGo/Software/Python/Examples
>>>
/home/pi/Dexter/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot
sudo chmod +x robot_web_server.py
sudo ./robot_web_server.py
NGGGGGGGGGGG!Error!!!!!!!!!!!!!

/home/pi/Dexter/GoPiGo/Software/Python/Examples/Basic_Robot_Control
sudo chmod +x basic_robot.py
sudo python basic_robot.py
No move!!!!!!!!!!!!

/home/pi/Dexter/GoPiGo3/Software/Python/Examples
sudo chmod +x Motor.py
sudo python Motor.py
NGGGGGGGGGGG!Error!!!!!!!!!!!!!

/home/pi/Dexter/GoPiGo3/Software/Python/Examples
sudo chmod +x easy_LED.py
sudo python easy_LED.py
NGGGGGGGGGGG!Error!!!!!!!!!!!!!

Browser Streaming Robot

/home/pi/Dexter/GoPiGo/Software/Python/Examples/Basic_Robot_Control_GUI
sudo chmod +x basic_robot_gui.py
sudo python basic_robot_gui.py
Now open the browser and enter
$ dex.local/
in the browser and hit enter to start streaming.
You’ll also see some activity in the terminal.

/home/pi/Dexter/GoPiGo3/Software/Python/Examples
sudo chmod +x easy_Motors.py
sudo python easy_Motors.py
NGGGGGGGGGGG!Error!!!!!!!!!!!!!

10/15
(Dexterの画面でupdate、Farmupgradeもやった後)

[0346]_Raspbian(Jissie)にRos(Indigo)を載せてGopigo3を動かす

Raspbian(Jessie)にRos(Indigo)を載せてGopigo3を動かす

http://ishi.main.jp/ros/ros_rpi3.html
手本

1.Raspbian(Jessie)のセットアップ

参考

Raspbian(Jessie)ダウンロード
http://ftp.jaist.ac.jp/pub/raspberrypi/raspbian/images/

日本語フォントをインストール
$ sudo apt-get update
$ sudo apt-get upgrade

(RaspberryPiの本より)
$ sudo apt update
$ sudo apt install ibus-mozc
$ sudo apt install fonts-ipafont fonts-ipaexfont
$ sudo reboot

–参考(Raspbianでは使わない:ここから)————
無線LANsetting

参考
$ sudo vi /etc/network/interfaces
dhcpという部分と、wpa-confという箇所を修正

$ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid=”MyNetwork”
psk=”MyPassPhrase”
}

日本語入力
$ sudo apt-get update
$ sudo apt-get install ibus-mozc

ホストの名前解決を行う

Raspberry Piにホスト名の設定をしたメモ


/etc/hostnameを編集
/etc/hostsを編集

エディタ(vim・gvim)インストール・設定
$ sudo apt-get update
$ sudo apt-get install vim
$ sudo apt-get install vim-gtk

–参考(Raspbianでは使わない:ここまで)————

■ROS Indigoのインストール
http://ishi.main.jp/ros/ros_rpi3.html
参考

$ sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu trusty main” > /etc/apt/sources.list.d/ros-latest.list’
$ wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O – | sudo apt-key add –
$ sudo apt-get update
$ sudo apt-get upgrade

$ sudo apt-get install python-pip python-setuptools python-yaml python-distribute python-docutils python-dateutil python-six
$ sudo pip install rosdep rosinstall_generator wstool rosinstall

$ sudo rosdep init
$ rosdep update

$ mkdir ~/ros_catkin_ws
$ cd ~/ros_catkin_ws

ROS-Commonのインストール
$ rosinstall_generator ros_comm –rosdistro indigo –deps –wet-only –exclude roslisp –tar > indigo-ros_comm-wet.rosinstall
$ wstool init src indigo-ros_comm-wet.rosinstall

$ rosdep install –from-paths src –ignore-src –rosdistro indigo -y -r –os=debian:jessie

<ここでgopigoのrosドライバを入れて、後で一緒にビルドしてみるか・・・・・ここから>
$ sudo apt-get install build-essential tmux vim -y
$ cd ~/ros_catkin_ws

$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/kinetic/ros-gopigo.rosinstall
(↑これはnot foundなので↓これをやってみる・・)
$ wget https://github.com/ros-gopigo/rosinstall-repo/blob/master/ros-gopigo.rosinstall

$ wstool init src ros-gopigo.rosinstall
(既にやっとる、、と。そらそーか・)

$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO
<ここでgopigoのrosドライバを入れて、後で一緒にビルドしてみるか・・・・・ここまで>

$ sudo ./src/catkin/bin/catkin_make_isolated –install -DCMAKE_BUILD_TYPE=Release –install-space /opt/ros/indigo
(↑これが・・・x/48・・と長くやってる・・
・・・・本当だ、途中で止まるワ!)

ビルドの途中でメモリ不足となり止まったので、-j 2オプションを追加して再実行
$ sudo ./src/catkin/bin/catkin_make_isolated –install -DCMAKE_BUILD_TYPE=Release –install-space /opt/ros/indigo -j2
(確かに、・・1時間くらいかかったワ!、でも2回目以降は10分くらい・・・)

<https://codezine.jp/article/detail/9829?p=5、より追加>
rosdepのインストールと初期化
$ sudo apt-get install python-rosdep
$ sudo rosdep init
$ rosdep update

$ source /opt/ros/indigo/setup.bash
$ echo “source /opt/ros/indigo/setup.bash” >> ~/.bashrc

$ roscore
(roscoreの起動はOK!)

<https://codezine.jp/article/detail/9829?p=5、より追加>
rosinstallのインストール
$ sudo apt-get install python-rosinstall

■GoPiGoのROS用ドライバーインストール
GoPiGoのROS用ドライバーを入れる(ここをgopigo3用に変えてみる
~/gopigo_ws

~/ros_catkin_ws
$ cd ~/ros_catkin_ws
$ sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash
$ sudo reboot

■GoPiGoのテスト走行

スライド2


手本
ターミナル1:ROSマスターの起動
$ roscore
ターミナル2:GoPiGoのROS用のドライバーの起動
$ sudo chmod a+rw /dev/i2c-1
$ roslaunch ropigo ropigo.launch
はい、エラー・・・
([ropigo.launch] is neither a launch file in package [ropigo] nor is [ropigo] a launch file name
The traceback for the exception was written to the log file)と言われる!!!
やはり、、、

うーーーーーーん、
[ropigo.launch] is neither a launch file in package [ropigo] nor is [ropigo] a launch file name
The traceback for the exception was written to the log file
と、ropigo.launchなんて無いよ!と言われたので、、、、

http://d.hatena.ne.jp/creativeability/
参考
$ rosdep install –from-paths src –ignore-src –rosdistro kinetic -y -r –os=debian:jessie
$ catkin_make

まだ、ropigo.launchなんて無いよ!と言われたので、、、、

参考
$ git clone https://github.com/karaage0703/raspberry-pi-setup
$ cd raspberry-pi-setup
$ ./setup-ros-indigo-ubuntu.sh
(ダメ・・・、これUbuntuのやつ!!、間違え!!!!)

再度・・・・

ターミナル1:ROSマスターの起動
$ roscore
ターミナル2:GoPiGoのROS用のドライバーの起動
$ sudo chmod a+rw /dev/i2c-1
$ roslaunch ropigo ropigo.launch
ターミナル3:0.2[rad/s]の速度で左回転させる
$ rostopic pub /cmd_vel geometry_msgs/Twist
“linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.2”

★★★★★★★★★★★★★★★★
★★GoPiGoのROS用ドライバー★★★★
★★★★★★★★★★★★★★★★
GoPiGoのドライバーをソースからビルド・インストール
$ sudo apt-get install build-essential tmux vim -y
$ mkdir ~/gopigo_ws
$ cd ~/gopigo_ws

$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/master/ros-gopigo.rosinstall

$ wstool init src ros-gopigo.rosinstall(←これだけ失敗、原因不明★)

$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO
$ catkin_make

GoPiGoのROS用ドライバーを入れる(ここをgopigo3用に変えてみるか・・・9/24)
$ cd ~/gopigo_ws
$ sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash
$ sudo reboot

$ cd ~/gopigo_ws
$ sudo curl -L dexterindustries.com/update_gopigo3 | bash
$ sudo reboot

(これが効く感じ・・・・・)
$ sudo bash /home/pi/Dexter/GoPiGo3/Install/install.sh
$ sudo reboot

・・・ダメ、まだ・・・
[ropigo.launch] is neither a launch file in package [ropigo] nor is [ropigo] a launch file name
The traceback for the exception was written to the log file

・・・ダメ、まだ・・・
gopigo_ws以下のパッケージをROSに読み込み
$ echo “source ~/gopigo_ws/devel/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

・・・ダメ、まだ・・・
/home/pi/gopigo_ws/src/ropigo/src/ropigo.cpp:9:27: fatal error: angles/angles.h:
そのようなファイルやディレクトリはありません
まだ、ropigo.launchなんて無いよ!と言われたので、、、、

参考
$ git clone https://github.com/karaage0703/raspberry-pi-setup
$ cd raspberry-pi-setup
$ ./setup-ros-indigo-ubuntu.sh

・・・ダメ、まだ・・・
rosinstallでdesktopを選択する
$ rosinstall_generator desktop –rosdistro indigo –deps –wet-only –exclude roslisp –tar > indigo-desktop-wet.rosinstall
$ wstool init src indigo-desktop-wet.rosinstall

・・・・・・・・・・・
・・・ダメ、まだ・・・
・・・・・・・・・・・
一度、~/gopigo_ws以下のフォルダ、ファイルを全部削除!
$ cd ~/gopigo_ws
$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/master/ros-gopigo.rosinstall
$ wstool init src ros-gopigo.rosinstall(←これだけ失敗、原因不明★)
$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO
$ catkin_make
(これが効く感じ・・・・・)
$ sudo bash /home/pi/Dexter/GoPiGo3/Install/install.sh
$ sudo reboot

★★★★★次ここ

再度・・・・

ターミナル1:ROSマスターの起動
$ roscore
ターミナル2:GoPiGoのROS用のドライバーの起動
$ sudo chmod a+rw /dev/i2c-1
$ roslaunch ropigo ropigo.launch
ターミナル3:0.2[rad/s]の速度で左回転させる
$ rostopic pub /cmd_vel geometry_msgs/Twist
“linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.2”

■GoPiGoのROS用ドライバーインストール

スライド1


手本

GoPiGoのドライバーをソースからビルド・インストール
~/gopigo_ws

~/ros_catkin_ws
に変えてみる

$ sudo apt-get install build-essential tmux vim -y
$ cd ~/ros_catkin_ws
$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/kinetic/ros-gopigo.rosinstall
(↑これはnot foundなので↓これをやってみる・・)
$ wget https://github.com/ros-gopigo/rosinstall-repo/blob/master/ros-gopigo.rosinstall

$ wstool init src ros-gopigo.rosinstall
$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO

$ catkin_make

★またメモリ不足でストップ、catkin_makeは先にビルドできているので不要かも・・

gopigo_ws以下のパッケージをROSに読み込み
$ echo “source ~/ros_catkin_ws/devel/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

■GoPiGoのテスト走行

スライド2


手本
ターミナル1:ROSマスターの起動
$ roscore
ターミナル2:GoPiGoのROS用のドライバーの起動
$ sudo chmod a+rw /dev/i2c-1
$ roslaunch ropigo ropigo.launch
ターミナル3:0.2[rad/s]の速度で左回転させる
$ rostopic pub /cmd_vel geometry_msgs/Twist
“linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.2”

$ sudo apt-get install build-essential tmux vim -y
$ mkdir ~/gopigo_ws
$ cd ~/gopigo_ws
$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/kinetic/ros-gopigo.rosinstall
$ wstool init src ros-gopigo.rosinstall
$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO
$ catkin_make

$ sudo apt-key adv –keyserver hkp://ha.pool.sks-keyservers.net –recv-key 0xB01FA116
$ sudo apt-get install ros-indigo-ros-base -y

rosdepのインストールと初期化
$ sudo apt-get install python-rosdep
$ sudo rosdep init
$ rosdep update

ROSの環境変数をシステムに反映
$ echo “source /opt/ros/indigo/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

rosinstallのインストール
$ sudo apt-get install python-rosinstall

GoPiGoのROS用ドライバー
GoPiGoのドライバーをソースからビルド・インストール
$ sudo apt-get install build-essential tmux vim -y
$ mkdir ~/gopigo_ws
$ cd ~/gopigo_ws

$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/master/ros-gopigo.rosinstall
$ wget https://github.com/ros-gopigo/rosinstall-repo/blob/master/ros-gopigo.rosinstall
$ wget https://github.com/ros-gopigo/rosinstall-repo/blob/master/ros-gopigo.rosinstall

$ wstool init src ros-gopigo.rosinstall(←これだけ失敗、原因不明★)

$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO
$ catkin_make

gopigo_ws以下のパッケージをROSに読み込み
$ echo “source ~/gopigo_ws/devel/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

GoPiGoのROS用ドライバーを入れる(ここをgopigo3用に変えてみるか・・・9/24)
$ cd ~/gopigo_ws
$ sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash
$ sudo reboot

$ cd ~/gopigo_ws
$ sudo curl -L dexterindustries.com/update_gopigo3 | bash

(これが効く感じ・・・・・)
$ sudo bash /home/pi/Dexter/GoPiGo3/Install/install.sh
$ sudo reboot

うーーーーーーん、
[ropigo.launch] is neither a launch file in package [ropigo] nor is [ropigo] a launch file name
The traceback for the exception was written to the log file
と、ropigo.launchなんて無いよ!と言われたので、、、、

http://d.hatena.ne.jp/creativeability/
参考
$ rosdep install –from-paths src –ignore-src –rosdistro kinetic -y -r –os=debian:jessie
$ catkin_make

まだ、ropigo.launchなんて無いよ!と言われたので、、、、

参考
$ git clone https://github.com/karaage0703/raspberry-pi-setup
$ cd raspberry-pi-setup
$ ./setup-ros-indigo-ubuntu.sh
(ダメ・・・、でも操作でのエラーはなくなった???9/24)

★★★★★
※ERROR: default sources list file already exists:
/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
と出た時は/etc/ros/rosdep/sources.list.d/ディレクトリにある20-default.listを削除(端末でディレクトリまで移動し、sudo rmで消せる)したあと
★★★★★

ROSdepの初期化
$ sudo rosdep init
$ sudo rosdep update

★★★★★★★★★★★★
$ wstool init src ros-gopigo.rosinstall(←これだけ失敗、原因不明★)
★★★★★★★★★★★★
をきちんと解決して、エラー消えた!
$ cd gopigo_ws
-rw-r–r– 1 pi pi 190 Oct 1 22:25 ros-gopigo.rosinstall
が正しいファイル(190byte程度のコマンド)であれば、
wtoolのコマンドが正しく走ってうまく行くはず。
で。
$ catkin_make
する
★★★★★★★★★★★★

(catkin_makeでエラーfatalなので、、まだ対処)
https://github.com/ros-gopigo/rosinstall-repo
参考
sudo apt install python-wstool
sudo apt install python-catkin-tools
source /opt/ros/kinetic/setup.bash
wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/master/ros-gopigo.rosinstall
rosdep install –from-paths src –ignore-src –rosdistro kinetic -y -r –os=debian:jessie

<メッセージは・・・angles/angles.hが無いみたい・・と>
ropigo/CMakeFiles/ropigo_node.dir/build.make:62: recipe for target ‘ropigo/CMakeFiles/ropigo_node.dir/src/ropigo.cpp.o’ failed
make[2]: *** [ropigo/CMakeFiles/ropigo_node.dir/src/ropigo.cpp.o] Error 1
CMakeFiles/Makefile2:986: recipe for target ‘ropigo/CMakeFiles/ropigo_node.dir/all’ failed
make[1]: *** [ropigo/CMakeFiles/ropigo_node.dir/all] Error 2
Makefile:138: recipe for target ‘all’ failed
make: *** [all] Error 2

catkin_makeでエラーのまま>>>>再度トライ!!

(10/02夜続き)

aptのパッケージインデックスを更新
$ sudo apt-get update
$ sudo apt-get upgrade

ROSビルド(ROS-Comm)に必要なパッケージをインストール
$ sudo apt-get install python-pip python-setuptools python-yaml python-distribute python-docutils python-dateutil python-six
$ sudo pip install rosdep rosinstall_generator wstool rosinstall

rosdepを初期化する
$ sudo rosdep init
$ rosdep update

ワークスペースへ移動
$ cd ~/gopigo_ws

rosinstallでdesktopを選択する
$ rosinstall_generator desktop –rosdistro indigo –deps –wet-only –exclude roslisp –tar > indigo-desktop-wet.rosinstall
$ wstool init src indigo-desktop-wet.rosinstall

(10/3)再度

aptのパッケージインデックスを更新
$ sudo apt-get update
$ sudo apt-get upgrade

ROSビルド(ROS-Comm)に必要なパッケージをインストール
$ sudo apt-get install python-pip python-setuptools python-yaml python-distribute python-docutils python-dateutil python-six
$ sudo pip install rosdep rosinstall_generator wstool rosinstall

ROSビルド(ROS-Desktop)に必要なパッケージをインストール
$ sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libboost-all-dev libaudit-devl

rosdepを初期化する
$ sudo rosdep init
$ rosdep update

rosinstallでdesktopを選択する
$ rosinstall_generator desktop –rosdistro indigo –deps –wet-only –exclude roslisp –tar > indigo-desktop-wet.rosinstall
$ wstool init src indigo-desktop-wet.rosinstall

catkinのワークスペースを作成する
$ mkdir ~/ros_catkin_ws
$ cd ~/ros_catkin_ws

ROSビルド(ROS-Desktop)に必要なパッケージをソースビルドする
$ mkdir ~/ros_catkin_ws/external_src
$ sudo apt-get install checkinstall cmake
$ sudo sh -c ‘echo “deb-src http://mirrordirector.raspbian.org/raspbian/ testing main contrib non-free rpi” >> /etc/apt/sources.list’
$ sudo apt-get update

<止め!>

****************************
(ここから1:別のやり方で)
https://qiita.com/utahkaA/items/126f93c3d73c4f5269e2
****************************
sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu jessie main” > /etc/apt/sources.list.d/ros-latest.list’
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O – | sudo apt-key add –
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip python-setuptools python-yaml python-distribute python-docutils python-dateutil python-six
sudo pip install rosdep rosinstall_generator wstool rosinstall
sudo rosdep init
rosdep update
mkdir ~/ros_catkin_ws
cd ~/ros_catkin_ws
rosinstall_generator ros_comm –rosdistro indigo –deps –wet-only –exclude roslisp –tar > indigo-ros_comm-wet.rosinstall
wstool init src indigo-ros_comm-wet.rosinstall
rosdep install –from-paths src –ignore-src –rosdistro indigo -y -r –os=debian:jessie
sudo ./src/catkin/bin/catkin_make_isolated –install -DCMAKE_BUILD_TYPE=Release –install-space /opt/ros/indigo -j2
source /opt/ros/indigo/setup.bash
echo “source /opt/ros/indigo/setup.bash” >> ~/.bashrc

(10/4、再度トライ)
sudo reboot
cd ~/ros_catkin_ws
catkin_make

(ここから<止め!のつづき>)
libconsole-bridge-devをビルドする
$ cd ~/ros_catkin_ws/external_src
$ sudo apt-get build-dep console-bridge
$ apt-get source -b console-bridge
$ sudo dpkg -i libconsole-bridge0.2*.deb libconsole-bridge-dev_*.deb

liblz4-devをビルドする
$ cd ~/ros_catkin_ws/external_src
$ apt-get source -b lz4
$ sudo dpkg -i liblz4-*.deb

liburdfdom-headers-devをビルドする
$ cd ~/ros_catkin_ws/external_src
$ git clone https://github.com/ros/urdfdom_headers.git
$ cd urdfdom_headers
$ cmake .
$ sudo checkinstall make install

liburdfdom-devをビルドする
$ cd ~/ros_catkin_ws/external_src
$ sudo apt-get install libboost-test-dev libtinyxml-dev
$ git clone https://github.com/ros/urdfdom.git
$ cd urdfdom
$ cmake .
$ sudo checkinstall make install

collada-dom-devをビルドする
$ cd ~/ros_catkin_ws/external_src
$ sudo apt-get install libboost-filesystem-dev libxml2-dev
$ wget http://downloads.sourceforge.net/project/collada-dom/Collada%20DOM/Collada%20DOM%202.4/collada-dom-2.4.0.tgz
$ tar -xzf collada-dom-2.4.0.tgz
$ cd collada-dom-2.4.0
$ cmake .
$ sudo checkinstall make install

collada_urdfにパッチを当てる
$ cd ~/ros_catkin_ws/src/robot_model/collada_urdf/
$ patch -p1 < ~/0001-fixed-arm-build.patch rvizのコードをARMビルド用に一部変更する。 $ nano ~/ros_catkin_ws/src/rviz/src/rviz/mesh_loader.cpp

[0345]_gopigo_wsの見直し

———————–
8.ワークスペースの設置
http://blog.livedoor.jp/gigakosuto-research/archives/803548.html
———————–
①ホームディレクトリにワークスペースを設置する。
$ rosws init ~/workspace /opt/ros/kinetic(←旧)
$ rosws init ~/gopigo_ws /opt/ros/kinetic

②サンドボックスディレクトリの作成
$ mkdir ~/workspace/sandbox(←旧)
$ mkdir ~/gopigo_ws/sandbox

sandboxディレクトリを作成したことでワークスペースの構成要素が変更されたので、setup.bashを読み込む。
$ source ~/workspace/setup.bash(←旧)
$ source ~/gopigo_ws/setup.bash

③そしてroswsを使ってパッケージディレクトリとして登録する。
$ rosws set ~/workspace/sandbox(←旧)
$ rosws set ~/gopigo_ws/sandbox

再度setup.bashを読み込みパス登録
$ source ~/workspace/setup.bash(←旧)
$ source ~/gopigo_ws/setup.bash

———————–
gopigo_ws以下のパッケージをROSに読み込み

スライド1


———————–
$ echo “source ~/gopigo_ws/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

rosdepのインストールと初期化
$ rosdep update

rosinstallのインストール
$ sudo apt-get install python-rosinstall

GoPiGoのドライバーをソースからビルド・インストール
$ cd ~/gopigo_ws
$ catkin_make

$ roslaunch webjoy_example webjoy_example.launch

(▲ダメ、デグレ、ropigo ropigo.launchが無い!って怒られた)

$ cd ~/gopigo_ws
$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/master/ros-gopigo.rosinstall
$ wstool init src ros-gopigo.rosinstall
$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO
$ catkin_make

GoPiGoのROS用ドライバーを入れる(ここをgopigo3用に変えてみる
$ cd ~/gopigo_ws
$ sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash
$ sudo reboot

(▲ダメ、デグレ、ropigo ropigo.launchが無い!って怒られた)

$ sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’
$ 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

スライド1


$ sudo apt-get install python-rosdep

$ sudo apt-get install python-rosinstall

(▲ダメ、デグレ、ropigo ropigo.launchが無い!って怒られた)

$ echo “source ~/gopigo_ws/devel/setup.bash” >> ~/.bashrc

sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash

sudo git clone http://www.github.com/DexterInd/GoPiGo3.git /home/pi/Dexter/GoPiGo3

(◎ropigo ropigo.launchが無い!はこれ↓↓↓↓で直った???)

$ sudo apt-get update
$ sudo apt-get install ros-kinetic-desktop-full

スライド1


$ sudo apt-get install python-rosdep
$ sudo apt-get install python-rosinstall

(◎wsを~/ros_catkin_wsと見てwebjoy_exampleらをコピーしたが???)

$ cd ~/ros_catkin_ws/src
$ catkin_create_pkg webjoy_example

webjoy_exampleの中身をコピーして。

$ cd ~/ros_catkin_ws
$ catkin_make

いちおう、エラーは消えたが、台車が動かん。。。

$ source ~/gopigo_ws/devel/setup.bash(旧)
$ source ~/ros_catkin_ws/devel/setup.bash(←対応するこれやってないけど関係あんのか??)

★★★★★★一発で起動するコマンド ★★★★★★
$ roslaunch webjoy_example webjoy_example.launch
★★★★★★★★★★★★★★★★★★★★★★★★
http://192.168.0.10:8080/stream_viewer?topic=/image_raw
★★★★★★★★★★★★★★★★★★★★★★★★
の画像はOKだけど
★★★★★★★★★★★★★★★★★★★★★★★★
http://192.168.0.10:8085/webjoy_example/index.html
★★★★★★★★★★★★★★★★★★★★★★★★
も画面表示はOKだけどモーター動作が不可・・・・

[0344]_tips_ubuntu1604

———————-
すいません通知とかこないんで気づいてなかったです.
セットアップの部分の詳細を教えてほしいとのことですが,python等で動くようになるまでのセットアップについてはDexterのページに載ってるものを使いました.https://www.dexterindustries.com/GoPiGo/get-started-with-the-gopigo3-raspberry-pi-robot/3-program-your-raspberry-pi-robot/python-programming-language/

まぁ上のやつに従うとユーザーがpi前提のスクリプトが実行されてしまうのでスクリプトファイルをcurlではなくwgetを使ってダウンロードしてユーザー名をひたすらに自分の名前に変更して実行すればなんとかなります.シェルが実行できればpythonのセットアップは完了.

rosで動くようにするにはc++のテストコードがうまく動かなかったので,元々のropigoのコードを参考にrospyで書き直しました.

全体的にまとまってないのでまだ書いてないですがqiitaとかでまとめようと思ってるのでqiitaとかでまとめたら管理者の人さえよければ再度コメントさせていただきたいです.

———————–

(10/7)ということでuser名をpiにしてRaspPi#3にUbuntu1604を再構築

———————–
日本語環境
———————–
http://www.dreamedge.net/archives/111
# apt-get install language-pack-ja
$ export LANG=ja_JP.UTF-8

# update-locale LANG=ja_JP.UTF-8
$ LANG=C xdg-user-dirs-gtk-update

———————–
SSH設定
———————–
ssh Serverをインストールします。
$ sudo apt-get install ssh
インストール後 デーモンを起動
$ sudo /etc/init.d/ssh start
これでリモートから接続可能になりました。

自動起動のセットも。
$ sudo vi /etc/rc.local
rc.local
#!/bin/sh -e
・・・・・
# By default this script does nothing.
sudo /etc/init.d/ssh start <----を追加!! exit 0 ----------------------- ubuntuで無線LAN設定 ----------------------- https://askubuntu.com/questions/775597/how-to-use-onboard-wifi-on-raspberry-pi-3-with-ubuntu-server-16-04 が参考になりそう $ lsusb $ sudo apt-get install wireless-tools $ sudo apt-get install wpasupplicant add to /etc/network/interfaces: --------------- auto wlan0 iface wlan0 inet dhcp wpa-essid smile wpa-psk 9D5BE022868CF #source /etc/network/interfaces.d/*.cfg ----------------------- ROS kineticをUbuntu16.04にインストールする ----------------------- http://blog.livedoor.jp/gigakosuto-research/archives/803548.html 参考 1. 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’

2. 鍵の設定
$ sudo apt-key adv –keyserver hkp://ha.pool.sks-keyservers.net:80 –recv-key 0xB01FA116

3. パッケージを最新のものにアップデート
$ sudo apt-get update

4. ROS のインストール
$ sudo apt-get install ros-kinetic-desktop-full

★★★★★
※ERROR: default sources list file already exists:
/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
と出た時は/etc/ros/rosdep/sources.list.d/ディレクトリにある20-default.listを削除(端末でディレクトリまで移動し、sudo rmで消せる)したあと
★★★★★

5.ROSdepの初期化
$ sudo rosdep init
$ sudo rosdep update

6.環境変数の設定
$ echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

7.rosinstallの準備
$ sudo apt-get install python-rosinstall

8.ワークスペースの設置
①ホームディレクトリにワークスペースを設置する。
$ rosws init ~/workspace /opt/ros/kinetic
②サンドボックスディレクトリの作成
$ mkdir ~/workspace/sandbox
sandboxディレクトリを作成したことでワークスペースの構成要素が変更されたので、setup.bashを読み込む。
$ source ~/workspace/setup.bash
③そしてroswsを使ってパッケージディレクトリとして登録する。
$ rosws set ~/workspace/sandbox
再度setup.bashを読み込みパス登録
$ source ~/workspace/setup.bash

※設定後のパスは次のコマンドで確認
echo $ROS_PACKAGE_PATH
結果は次のようになることを確認。
 /home/your_user_name/workspace/sandbox:/opt/ros/kinetic/share
(はい、なってます。。。ありがとうございます!)

———————–
Raspberry Pi の I2C を有効化
———————–

Raspberry Pi の I2C を有効化する方法 (2015年版)


で済み

———————–
GoPiGoのROS用ドライバーを入れる
———————–
$ sudo apt-get install build-essential tmux vim -y
$ mkdir ~/gopigo_ws
$ cd ~/gopigo_ws
$ wget https://raw.githubusercontent.com/ros-gopigo/rosinstall-repo/master/ros-gopigo.rosinstall

$ wstool init src ros-gopigo.rosinstall
▲エラー▲
(ERROR: Rosdep experienced an error: [Errno 13] Permission denied: ‘/home/pi/.ros/rosdep/sources.cache/index’)

$ rosdep install –from-paths src –ignore-src –rosdistro $ROS_DISTRO
$ catkin_make
(catkin_makeが通ればビルド完了)
ビルド済みバイナリをROSで使えるように、そのパスを.bashrcに書き込んでいます
$ echo “source ~/gopigo_ws/devel/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

<#roscoreがうまくいってない、>
pi@pi-Raspberry3:~/gopigo_ws$ roscore
Traceback (most recent call last):
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py”, line 257, in main
write_pid_file(options.pid_fn, options.core, options.port)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py”, line 110, in write_pid_file
with open(pid_fn, “w”) as f:
IOError: [Errno 13] Permission denied: ‘/home/pi/.ros/roscore-11311.pid’
<・・・・・・・・・・・・・・>

GoPiGoのROS用ドライバーを入れる(ここをgopigo3用に変えてみる
$ cd ~/gopigo_ws
$ sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash
$ sudo reboot

Quick Install
In order to quick install the GoPiGo3 repository, open up a terminal and type the following command:
$ cd ~/gopigo_ws
$ sudo curl -L dexterindustries.com/update_gopigo3 | bash

Installation
You can install the GoPiGo3 on your own operating system with the following commands in the command line:
Clone this repository onto the Raspberry Pi:
$ sudo git clone http://www.github.com/DexterInd/GoPiGo3.git /home/pi/Dexter/GoPiGo3

ダメ・・・で

を参考
$ git clone https://github.com/karaage0703/raspberry-pi-setup
$ cd raspberry-pi-setup
$ ./setup-ros-indigo-raspbian.sh

$ roscore
$ pip install –upgrade pip

ダメ・・・で
(9/25、IndigoでなくKineticを再度インストールする)
http://wiki.ros.org/kinetic/Installation/Ubuntu

$ sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’
Set up your keys
$ sudo apt-key adv –keyserver hkp://ha.pool.sks-keyservers.net:80 –recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

Installation
First, make sure your Debian package index is up-to-date:
$ sudo apt-get update
$ sudo apt-get install ros-kinetic-desktop-full

スライド1


$ sudo apt-get install python-rosdep

$ sudo apt-get install python-rosinstall

★★★★★
(★下記で、permission denyedは解消された!!★すげー!!)
★★★★★
https://answers.ros.org/question/60366/problem-with-roscore/

sudo su
rm -R ~/.ros/

After that, roscore worked well and a new .ros folder was created automatically.

roscore

はエラーなし!OK。。。

(うーーーーーーん、でもテスト走行失敗・・・動かず・・・やはりダメか・・)

———————–
もう!カメラ準備に続く・・・
———————–
「GoPiGo」USBカメラ、Web、スマホで見る
https://codezine.jp/article/detail/10068
参考

【1】準備
必要なROSパッケージのインストール
(Indigoでなくてkineticだよ!!!!!!!)
$ sudo apt-get update
★★★★★★
$ sudo apt-get install ros-kinetic-rosbridge-suite ros-kinetic-roswww ros-kinetic-libuvc-camera ros-kinetic-web-video-server
★★★★★★

$ rospack profile

USBデバイス一覧表示
(Logitech, Inc. Webcam C270の表示確認)
$ lsusb
yoshi3@yoshi3-raspberry:~$ lsusb
Bus 001 Device 006: ID abcd:1234 Unknown
Bus 001 Device 005: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

新規に/etc/udev/rules.d/99-uvc.rulesというファイルを作り、下記をコピペ
$ sudo vi /etc/udev/rules.d/99-uvc.rules
SUBSYSTEMS==”usb”, ENV{DEVTYPE}==”usb_device”, ATTRS{idVendor}==”046d”, ATTRS{idProduct}==”0825″, MODE=”0666″

ROSマスターの起動
$ roscore

USBカメラノードを起動
$ rosrun libuvc_camera camera_node

ノード名の一覧表示
(カメラノード名は/libuvc_camera、、、と確認)
$ rosnode list
/libuvc_camera
/rosout

/libuvc_cameraノードに関する情報を確認
/libuvc_cameraノードの情報を表示
$ rosnode info /libuvc_camera

【2】web_video_serverパッケージを利用
動画ストリーミングサーバ起動
$ rosrun web_video_server web_video_server
[ INFO] [1490083960.186788634]: Waiting For connections on 0.0.0.0:8080

最後に、カメラ映像を確認
http://GoPiGoのIPアドレス:8080/stream_viewer?topic=/image_raw
なので、、、
http://192.168.0.6:8080/stream_viewer?topic=/image_raw

ここまでOK!

———————–
【3】スマホからGoPiGoを操作
———————–
スマホなどのブラウザからGoPiGoを操作する機能を追加
パッケージを作成するには、catkin_create_pkgコマンドを使用
新規パッケージの作成
$ cd ~/gopigo_ws/src
$ catkin_create_pkg webjoy_example

https://codezine.jp/article/detail/10068?p=3
より頂いたサンプルをwebjoy_exampleフォルダ内にコピー

$ pwd
/home/yoshi3/gopigo_ws/src/webjoy_example

webjoy_example
├── CMakeLists.txt
├── launch
│ └── webjoy_example.launch
├── package.xml
└── www
├── index.html
└── webjoy.js

パッケージのビルドと読み込み
(ビルドする場所に注意)
$ cd /home/yoshi3/gopigo_ws
(ここでビルドする)

$ cd .. && catkin_make
$ source ~/gopigo_ws/devel/setup.bash

ここまでOK!

———————–
【4】Webサーバを立てる
———————–
スマホなどの外部デバイスにリソースを配信するためにWebサーバが必要。
今回は、習ってroswwwというROSのパッケージを使ってWebサーバを立てる。
デフォルトで8085番ポートをクライアント接続用に解放。
Webサーバの起動
$ roslaunch roswww roswww.launch

Webサーバの起動後、下記にアクセス。
http://GoPiGoのIPアドレス:8085/webjoy_example/index.html
より
Webサーバの起動後、下記にアクセスしてみましょう。
http://192.168.0.10:8085/webjoy_example/index.html

あれ?表示NGダメだな??
カメラの電源も入ってないので起動させてもう一回やろう。。。。
https://codezine.jp/article/detail/10068?p=3

【4】カメラ起動から・・
①ROSマスターの起動
$ roscore

②USBカメラノードを起動
$ rosrun libuvc_camera camera_node

③動画ストリーミングサーバ起動
$ rosrun web_video_server web_video_server
[ INFO] [1490083960.186788634]: Waiting For connections on 0.0.0.0:8080

④Webカメラ映像を確認
http://192.168.0.10:8080/stream_viewer?topic=/image_raw

OK!!
このままスマホ確認に。

④Webサーバの起動
$ roslaunch roswww roswww.launch
Webサーバの起動後、下記にアクセス。
(Edgeでは表示不可、chromeで表示!!)
http://192.168.0.10:8085/webjoy_example/index.html

★★★★★★一発で起動するコマンド ★★★★★★
$ roslaunch webjoy_example webjoy_example.launch
★★★★★★★★★★★★★★★★★★★★★★★★
http://192.168.0.10:8080/stream_viewer?topic=/image_raw
★★★★★★★★★★★★★★★★★★★★★★★★
の画像はOKだけど
★★★★★★★★★★★★★★★★★★★★★★★★
http://192.168.0.10:8085/webjoy_example/index.html
★★★★★★★★★★★★★★★★★★★★★★★★
も画面表示はOKだけどモーター動作が不可・・・・

やはり・・・だめかーーーーー!!!

[0343]_RaspberryPi3にUbuntu14.04を

Ubuntu14.04 on RaspberryPi3

参考
RaspberryPi3にUbuntu14.04をインストールする方法

RaspberryPi3にUbuntu14.04をインストールする方法

Ubuntu MATE 16.06のファイルを使用する場合

2015-04-06-ubuntu-trusty.zipをダウンロード
https://wiki.ubuntu.com/ARM/RaspberryPi
2015-04-06-ubuntu-trusty.imgを展開

ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img.xzをダウンロード
https://ubuntu-mate.org/download/#xenial
ubuntu-mate-16.04-desktop-armhf-raspberry-pi.imgを展開

kpartxでimgファイルのデバイスマップを作成しマウント

sudo kpartx -av ~/Downloads/2015-04-06-ubuntu-trusty.img

sudo kpartx -av ~/Downloads/ubuntu-mate-16.04-desktop-armhf-raspberry-pi.img

[0342]_python試す

/home/yoshi3/gopigo_ws/devel

yoshi3@yoshi3-RasPai3:~/gopigo_ws/devel$ ls -l
total 88
-rw-rw-r– 1 yoshi3 yoshi3 34513 Sep 30 18:10 gopigo3.py
-rw-rw-r– 1 yoshi3 yoshi3 1804 Sep 30 18:03 hardware_test.py
-rw-rw-r– 1 yoshi3 yoshi3 1514 Sep 30 18:00 motor.py

pthonファイルを試す

URLは、
https://github.com/DexterInd/GoPiGo3/blob/master/Software/Python/easygopigo3.py

(9/30 gopigo_wsでgopigo3のドライバをインストール)
cd gopigo_ws
sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash

[0341]_retry_ros_kinetic

How To install ROS Kinetic on Raspberry Pi 3 (Ubuntu Mate)

Step 3: Setup your 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’

Step 4: Setup your keys
wget http://packages.ros.org/ros.key -O – | sudo apt-key add –

Step 5: To be sure that your Ubuntu Mate package index is up to date, type the following command
sudo apt-get update

Step 6: Install ros-kinetic-desktop-full
sudo apt-get install ros-kinetic-desktop-full

Step 7: Initialize rosdep
sudo rosdep init

rosdep update

Step 8: Setting up the ROS environment variables
echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
source ~/.bashrc

Step 9: Create and initialize the catkin workspace
mkdir -p ~/catkin_workspace/src
cd catkin_workspace/src
catkin_init_workspace
cd ~/catkin_workspace/
catkin_make

Step 10: Add the catkin_workspace to your ROS environment
source ~/catkin_workspace/devel/setup.bash

Step 11: Check the ROS environment variables
export | grep ROS

【3】GoPiGoのROS用ドライバーを入れる(ここをgopigo3用に変えてみるか・・・9/24)
$ cd ~/catkin_workspace/
$ sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo3.sh | bash
$ sudo reboot

<ここから・・・・>
Quick Install
In order to quick install the GoPiGo3 repository, open up a terminal and type the following command:
$ cd ~/catkin_workspace/
$ sudo curl -L dexterindustries.com/update_gopigo3 | bash

Installation
You can install the GoPiGo3 on your own operating system with the following commands in the command line:
Clone this repository onto the Raspberry Pi:
$ sudo git clone http://www.github.com/DexterInd/GoPiGo3.git /home/pi/Dexter/GoPiGo3

Run the install script:
$ sudo bash /home/pi/Dexter/GoPiGo3/Install/install.sh

Reboot the Raspberry Pi to make the settings take effect:
$ sudo reboot

(ダメ・・・9/30)