[0354]★★_CDNを変更してみる

cd /home/pi/gopigo_ws/src/webjoy_example/www




を、下記に書き換える
https://groups.google.com/forum/m/#!msg/robot-web-tools/plGsZWwtNv8/1M3QCCV3AgAJ
を参照しました!




で、どうだ!?

★★★★★★★★★★ここまでのコマンド★★★★★★★★★★★
roscore
rosrun libuvc_camera camera_node
rosrun web_video_server web_video_server
roslaunch rosbridge_server rosbridge_websocket.launch
roslaunch roswww roswww.launch

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
一発で起動するコマンド
roslaunch webjoy_example webjoy_example.launch
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

■■■■■■■■■■■■■■■■■■■■■■■■
http://192.168.0.10:8080/stream_viewer?topic=/image_raw
■■■■■■■■■■■■■■■■■■■■■■■■
http://192.168.0.10:8085/webjoy_example/index.html
http://192.168.0.12:8085/webjoy_example/index.html
■■■■■■■■■■■■■■■■■■■■■■■■

よっしゃー!!!(映った!!!)

ここでいよいよ、
「ROSでgopigo3を走らせる」
https://qiita.com/cut0ter/items/0326f5dee89456e47001
をマージしてみる!

roscore
python gopigo3_ros.py
で動く準備ができているから・・・・

同じようにしてみる・・・・

rosでモーターを動かす.
~/Dexter/GoPiGo3/Software/Python
ディレクトリにモーター制御のコードを書いていく
https://qiita.com/cut0ter/items/0326f5dee89456e47001
ファイル名は、
gopigo3_ros.py
で、下記コマンドを追加!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
roscore
rosrun libuvc_camera camera_node
rosrun web_video_server web_video_server
roslaunch rosbridge_server rosbridge_websocket.launch
roslaunch roswww roswww.launch
python gopigo3_ros.py  <===追加!!!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

OK!!!動いた!映った!!!!!

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
一発で起動するコマンド も修正!
でも難しいから、当面は2行コマンドでやろう・・・・・
roslaunch webjoy_example webjoy_example.launch
python /home/pi/Dexter/GoPiGo3/Software/Python/gopigo3_ros.py
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

[0353]★★★_piでubuntuやってみる

■[0331]

[0331]_ROSkineticをUbuntu16.04にインストール


を参考に

———————–
Ubuntu1604の焼き付け
———————–
SD Card準備
———————–
日本語locale設定
———————–
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 ----------------------- sudo apt-get update sudo apt-get upgrade -------------------- Raspberry Pi の I2C を有効化 -------------------- $ sudo apt-get update $ sudo apt-get install i2c-tools 初期設定画面を起動します。 $ sudo raspi-config ■ROSkineticをUbuntu16.04にインストールする http://blog.livedoor.jp/gigakosuto-research/archives/803548.html https://codezine.jp/article/detail/9829?p=5 を参考に $ sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX $ 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
(sudo apt-get install ros-kinetic-desktop)
(時間かかるワ・・)

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

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

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

(なんとか、roscoreまで動いた!)

(これ、飛ばす・・・)
■8.ワークスペースの設置
①ホームディレクトリにワークスペースを設置する。
($ rosws init ~/workspace /opt/ros/kinetic)
$ rosws init ~/gopigo_ws /opt/ros/kinetic

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

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

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

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

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

■ROSでgopigo3を走らせる
https://qiita.com/cut0ter/items/0326f5dee89456e47001
を参考に
gopigo3のドライバをインストールする
sudo curl -kL dexterindustries.com/update_gopigo3 | bash

sudo reboot

You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

The directory ‘/home/pi/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.

The directory ‘/home/pi/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Requirement already satisfied (use –upgrade to upgrade): numpy in /usr/lib/python2.7/dist-packages

You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

The directory ‘/home/pi/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.

The directory ‘/home/pi/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Requirement already satisfied (use –upgrade to upgrade): numpy in /usr/lib/python3/dist-packages

You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

==========モータ動作は後で試す、まずはカメラを=============

cd ~/Dexter/GoPiGo3/Software/Python/Examples
python easy_Motors.py #これでモーターが動いたらインストール完了

(これ、飛ばす・・・ここから再開・・・・)
■【3】GoPiGoのROS用ドライバーを入れる
多分、ropigoのインストールで以下も必要と思う・・・・
$ 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
(catkin_makeが通ればビルド完了)

ビルド済みバイナリをROSで使えるように、そのパスを.bashrcに書き込んでいます
$ echo “source ~/gopigo_ws/devel/setup.bash” >> ~/.bashrc
$ source ~/.bashrc

■[0333]WebCameraまでOK、モータ動かず
https://codezine.jp/article/detail/10068
を参考に

【1】準備
必要なROSパッケージのインストール

$ sudo apt-get update
(Indigoでなくてkineticだよ!)
$ sudo apt-get install ros-indigo-rosbridge-suite ros-indigo-roswww ros-indigo-libuvc-camera ros-indigo-web-video-serve
なので、、、上記でなくて・・・(エラーになる)
$ sudo apt-get install ros-kinetic-rosbridge-suite ros-kinetic-roswww ros-kinetic-libuvc-camera ros-kinetic-web-video-server
を実施
$ rospack profile

新規に/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マスターの起[[8動
$ roscore
次に、カメラ画像を取得するためにカメラノードを起動します。
USBカメラノードを起動
$ rosrun libuvc_camera camera_node
前回解説したように、コマンドラインでノード名の一覧を表示しましょう。カメラノード名を確認します。
ノード名の一覧表示
$ rosnode list
/libuvc_camera
/rosout

動画ストリーミングサーバ起動
$ 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.10:8080/stream_viewer?topic=/image_raw
http://192.168.0.12:8080/stream_viewer?topic=/image_raw
(OK!映っている!!)

https://codezine.jp/article/detail/10068?p=3
スマホからGoPiGoを操作できるようにする
を参考に

新規パッケージの作成
$ cd ~/gopigo_ws/src
$ catkin_create_pkg webjoy_example

webjoy_exampleフォルダ内にコピーして、以下の構成になるようにしてください。
webjoy_example
├── CMakeLists.txt
├── launch
│ └── webjoy_example.launch
├── package.xml
└── www
├── index.html
└── webjoy.js

パッケージのビルドと読み込み
$ cd .. && catkin_make

$ source ~/gopigo_ws/devel/setup.bash
(source ~/workspace/devel/setup.bash)
Webサーバの起動
$ roslaunch roswww roswww.launch

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

★★★★★★★★★★ここにgopigo3のドライバをインストール★★★★★★★★★★★

★★★★★★★★★★★★★★★
(おおお!、ついに書いてくれたあ!!!!)
https://qiita.com/cut0ter/items/0326f5dee89456e47001
参考
★★★★★★★★★★★★★★★

GoPiGo3 Tutorials & Documentation

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

cd ~/Dexter/GoPiGo3/Software/Python/Examples
python easy_Motors.py #これでモーターが動いたらインストール完了
(うん、動いた!OK!)

cd /home/pi/gopigo_ws
sudo curl -kL dexterindustries.com/update_gopigo3 >> update_gopigo3.sh

cd ~/Dexter/GoPiGo3/Software/Python
vi gopigo3_ros.py

==============================
以下、頂いたコード(gopigo3_ros.py)
==============================
#!/usr/bin/env python

import rospy
import math
from std_msgs.msg import Int16
from geometry_msgs.msg import Twist
import easygopigo3 as easy

gpg = easy.EasyGoPiGo3()

def callback(data):
t = data.linear.x;
r = data.angular.z;

mag = math.sqrt(pow(t,2)+pow(r,2));

if mag <= 0.1: motor1(0); motor2(0); else: m1 = 0; m2 = 0; m1 = t/mag * abs(t); m2 = t/mag * abs(t); m1 += r/mag * abs(r); m2 += -r/mag * abs(r); m1 = m1/abs(m1) * min(abs(m1), 1.0); m2 = m2/abs(m2) * min(abs(m2), 1.0); motor1(m1*255) motor2(m2*255) def motor1(dps): gpg.set_motor_dps(gpg.MOTOR_RIGHT, dps) def motor2(dps): gpg.set_motor_dps(gpg.MOTOR_LEFT, dps) def listener(): rospy.init_node('listener', anonymous=True) rospy.Subscriber("cmd_vel", Twist, callback) lwheel = rospy.Publisher("lwheel", Int16, queue_size=1) rwheel = rospy.Publisher("rwheel", Int16, queue_size=1) init_encoders = gpg.read_encoders() init_lwheel = init_encoders[0] init_rwheel = init_encoders[1] r = rospy.Rate(20) while not rospy.is_shutdown(): encoders = gpg.read_encoders() lwheel.publish(encoders[0] - init_encoders[0]) rwheel.publish(encoders[1] - init_encoders[1]) r.sleep() motor1(0) motor2(0) if __name__ == '__main__': listener() ============================== ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ http://192.168.0.9:8085/webjoy_example/index.html ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ 一発で起動するコマンド も修正! でも難しいから、当面は2行コマンドでやろう・・・・・ roslaunch webjoy_example webjoy_example.launch (ubuntu #2はこっち↓) python /home/pi/Dexter/GoPiGo3/Software/Python/gopigo3_ros.py (ubuntu #1はこっち↓) python /home/pi/GoPiGo3/Software/Python/gopigo3_ros.py ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ <<<<以下はm、いらないかも・・・(苦労話だけ・・)>>>> ★★★★★★★★★★ここまでのコマンド★★★★★★★★★★★ roscore rosrun libuvc_camera camera_node rosrun web_video_server web_video_server roslaunch rosbridge_server rosbridge_websocket.launch roslaunch roswww roswww.launch roslaunch ropigo ropigo.launch ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ 一発で起動するコマンド roslaunch webjoy_example webjoy_example.launch ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ /home/pi/workspace/sandbox に webjoy_example ├── CMakeLists.txt ├── launch │ └── webjoy_example.launch ├── package.xml └── www ├── index.html └── webjoy.js を構築してみる・・・ ==========ここから============= /home/pi/workspace/ で 作ってみる。 $ 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 (catkin_makeが通ればビルド完了) gopigo_ws以下のパッケージをROSに読み込み $ echo "source ~/workspace/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

でどうか?(ダメかあ・・・・・・・・)

core service [/rosout] found
process[roswww-1]: started with pid [2889]
2017-11-22 22:03:28,835 – roswww – INFO – roswww : # of packages : 181
2017-11-22 22:03:28,836 – roswww – INFO – roswww : Weg Page root : www
2017-11-22 22:03:29,110 – roswww – INFO – roswww : Initialised
2017-11-22 22:03:29,111 – roswww – INFO – roswww : Attempting to start webserver on port 8085
2017-11-22 22:03:29,119 – roswww – INFO – roswww : Webserver successfully started on port 8085
WARNING:tornado.access:404 GET /webjoy_example/index.html (192.168.0.12) 5.38ms
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.12) 4.93ms
WARNING:tornado.access:404 GET /webjoy_example/index.html (192.168.0.12) 2.82ms
WARNING:tornado.access:404 GET /webjoy_example/index.html (192.168.0.12) 5.87ms

==========ここから=============
Unable to read from GoPiGo (errno 9): Bad file descriptor
Unable to read from GoPiGo (errno 9): Bad file descriptor
Error writing to GoPiGo (errno 9): Bad file descriptor
Unable to read from GoPiGo (errno 9): Bad file descriptor
Unable to read from GoPiGo (errno 9): Bad file descriptor
Error writing to GoPiGo (errno 9): Bad file descriptor
Unable to read from GoPiGo (errno 9): Bad file descriptor
Unable to read from GoPiGo (errno 9): Bad file descriptor
Error writing to GoPiGo (errno 9): Bad file descriptor
Error writing to GoPiGo (errno 9): Bad file descriptor
Error writing to GoPiGo (errno 9): Bad file descriptor
Error writing to GoPiGo (errno 9): Bad file descriptor

==========まだまだ=============
なんちゃらファイルの読み込みができてないみたいなので、
i2c-1が+rwできてないから、そのファイルの復活(っていうか見える化)から。

https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q11144293451
を参考
/boot/config.txt
の末尾に
dtparam=i2c_arm=on
を追加して、
/etc/modules
の末尾に
i2c-dev
を追加して、リブートします。
わたしの、Raspberry PI 2 は、これで、
/dev/i2c-1
が出来ましたよ。

==========まだまだ=============
WARNING:tornado.access:404 GET /webjoy.js (192.168.0.12) 3.07ms
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.12) 2.72ms

WARNING:tornado.access:404 GET /webjoy_example/www/webjoy.js (192.168.0.12) 4.18ms
WARNING:tornado.access:404 GET /webjoy_example/www/webjoy.js (192.168.0.12) 3.23ms
WARNING:tornado.access:404 GET /webjoy_example/www/webjoy.js (192.168.0.12) 3.42ms

WARNING:tornado.access:404 GET /favicon.ico (192.168.0.12) 2.87ms
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.12) 2.66ms
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.12) 5.48ms
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.12) 5.80ms

==========まだまだ=============
(11/24)
Nodejsをインストールしたけど・・・・
http://co.bsnws.net/article/121
参考

sudo apt-get install -y nodejs
node -v

でもダメ・・・・表示されず・・・・

==========まだまだ=============
(11/24)
nodejsをインストール
https://qiita.com/suzuki-sapporo/items/1748dcaacfe244010980
を参考

2. 展開
tar xvf node-v8.9.1-linux-x64.tar.xz
3. シンボリックリンクを張る。
ln -s node-v8.9.1-linux-x64 node
4. PATHを通す。
.profile に以下の行を追加する。
export NODE_HOME=$HOME/node
export NODE_PATH=$NODE_HOME/lib/node_modules
export PATH=$NODE_HOME/bin:$PATH
PATHを適用する。
source .profile
5. 動作確認
node –version

==========まだまだ=============
初アクセスすると、
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.12) 5.58ms
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.6) 5.26ms
がサーバ側の履歴に必ず出る・・・・

pip install tornado
pip install –upgrade pip

==========まだまだ=============
roslibjsをインストールしてみる

https://github.com/RobotWebTools/roslibjs.git

==========まだまだ=============
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

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

==========まだまだ=============
/workspace/sandboxでやってみる

$ cd ~/workspace/sandbox
$ catkin_create_pkg webjoy_example

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

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

==========まだまだ=============
index.htmlに直接webjoy.jsを書き込んでもダメ・・・

==========まだまだ=============
i2c-toolsを導入し、i2cグループにユーザーubuntu(pi)を追加

サンプルページ


をやってみる

$ sudo apt-get update
$ sudo apt-get install i2c-tools
$ sudo groups pi
pi : pi adm cdrom sudo dip video plugdev input lpadmin gpio i2c spi sambashare
$ sudo usermod -aG i2c pi
$ sudo groups pi
pi : pi adm cdrom sudo dip video plugdev input lpadmin gpio i2c spi sambashare
(既にやってるので変わらん・・・・)

==========まだまだ=============
roswwwを再インストールしてみる
http://flow-developers.hatenablog.com/category/ROS
参考
roswwをRaspberrypiにinstallするコマンド
# roswwwのUsrageはこちら.

# ROSのworkspaceに移動する.
cd ~/gopigo_ws/src

# 最新のroswwwを取得する.
git clone https://github.com/tork-a/roswww.git

# catkin_makeを実行する.
cd ~/gopigo_ws

sudo ./src/catkin/bin/catkin_make_isolated –install –install-space /opt/ros/kinetic –pkg roswww
source /opt/ros/indigo/setup.bash

# [TIPS] launchファイルが2か所に同じ名前であるので、どちらかを消す.
/opt/ros/kinetic/share/roswww

~/gopigo_ws/src/roswww/launch
どちらかの
roswww.launch と start_bridge.launch
を消す.※中身は同じですが競合してlaunch実行がErrになるため.

# 最後にサーバー立つか,実行して確認しinstall完了.
roslaunch roswww webjoy_example.launch
roslaunch webjoy_example webjoy_example.launch

(これやったら、壊れた。。)
pi@pi3:~/gopigo_ws$ roslaunch webjoy_example webjoy_example.launch
プログラム ‘roslaunch’ はまだインストールされていません。 次のように入力することでインストールできます:
sudo apt install python-roslaunch
pi@pi3:~/gopigo_ws$ sudo apt install python-roslaunch
パッケージリストを読み込んでいます… 完了
依存関係ツリーを作成しています
状態情報を読み取っています… 完了
インストールすることができないパッケージがありました。おそらく、あり得
ない状況を要求したか、(不安定版ディストリビューションを使用しているの
であれば) 必要なパッケージがまだ作成されていなかったり Incoming から移
動されていないことが考えられます。
以下の情報がこの問題を解決するために役立つかもしれません:

以下のパッケージには満たせない依存関係があります:
python-roslaunch : 依存: python-roslib しかし、インストールされようとしていません
E: 問題を解決することができません。壊れた変更禁止パッケージがあります。

(ああーーーーーーあ・・)
==========まだまだ=============

pipをアップグレードしてみる
https://askubuntu.com/questions/744377/cache-pip-disabled-immediately-after-instalation-of-pip
参考
sudo -H pip install –upgrade pip

AWS CLIをpipインストールした際にエラーとなった時の対処方法について


参考
$ sudo python -m pip install –upgrade pip
でも、pip8.1.1のまま、pip9.0.1にはならず・・・・

https://askubuntu.com/questions/744377/cache-pip-disabled-immediately-after-instalation-of-pip
参考で
sudo apt-get install python-pip
もやっておく

pip3 install -U pip

pipをアップグレードする方法
http://kaworu.jpn.org/python/Pythonのパッケージ管理システムpipをアップグレードする方法
参考
sudo pip install –upgrade pip
sudo pip install –upgrade pip

==========まだまだ=============

Python-2.7.14.tar.xz

tar.xz
圧縮
tar -Jcvf xxxx.tar.xz directory
解凍
tar -Jxvf Python-2.7.14.tar.xz

python-3.6.3-embed-amd64.zip

[0352]_★ros_kinetic_install

スライド1


を参考に写すと、
$ sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX
$ sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu trusty main” > /etc/apt/sources.list.d/ros-latest.list’
$ sudo apt-key adv –keyserver hkp://ha.pool.sks-keyservers.net –recv-key 0xB01FA116
$ sudo apt-get update
$ sudo apt-get install ros-indigo-ros-base -y
なので、、、、

http://wiki.ros.org/action/show/kinetic/Installation/Ubuntu?action=show&redirect=kinetic%2FInstallation%2FUbuntuARM
参考でkineticに書き換えると、、
sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX
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-ros-base

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

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

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

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

gopigo3のドライバーをインストール
https://pypkg.com/pypi/gopigo3-test/
参考
sudo pip install gopigo3-test
/usr/local/lib/python2.7/dist-packages

★★★★★★★★★★★★★★★
(おおお!、ついに書いてくれたあ!!!!)
https://qiita.com/cut0ter/items/0326f5dee89456e47001
参考
★★★★★★★★★★★★★★★
1つめ
roscore

2つめ
(roslaunch ropigo ropigo.launchのコマンドでなく・・・・Web作者が作ってくれたpythonで動かす)
/home/pi/Dexter/GoPiGo3/Software/Python
python gopigo3_ros.py

3つめ
rostopic pub /cmd_vel geometry_msgs/Twist ‘[0.2, 0.0, 0.0]’ ‘[0.0, 0.0, 0.0]’
rostopic pub /cmd_vel geometry_msgs/Twist ‘[0.0, 0.0, 0.0]’ ‘[0.0, 0.0, 0.2]’

動いた・・・・・やった・・・でも画像がでない・・・

なので・・まとめると、
ここまで起動中のコマンド
$ roscore
$ rosrun libuvc_camera camera_node
$ rosrun web_video_server web_video_server
$ roslaunch rosbridge_server rosbridge_websocket.launch
$ roslaunch roswww roswww.launch
GoPiGoの台車ノードの起動
$ cd /home/pi/Dexter/GoPiGo3/Software/Python
$ python gopigo3_ros.py
GoPiGoの台車ノードの起動
http://GoPiGoのIPアドレス:8085/webjoy_example/index.html
http://192.168.0.10:8085/webjoy_example/index.html

(11/10)
なので、カメラの部分を再度構築しなおす(インストールしなおす)
https://codezine.jp/article/detail/10068
参考

パッケージのインストール(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

$ roscore
$ rosrun libuvc_camera camera_node

動画ストリーミングサーバ起動
$ rosrun web_video_server web_video_server

http://GoPiGoのIPアドレス:8080/stream_viewer?topic=/image_raw
http://192.168.0.10:8080/stream_viewer?topic=/image_raw
(うん!映ってる・・・OK!)

$ cd /home/pi/gopigo_ws
$ catkin_make
$ source ~/gopigo_ws/devel/setup.bash

Webサーバの起動
$ roslaunch roswww roswww.launch

Webサーバの起動後、下記にアクセスしてみましょう。
http://GoPiGoのIPアドレス:8085/webjoy_example/index.html
http://192.168.0.9:8085/webjoy_example/index.html
(あれーーーダメだな・・・NG)

一発で起動するコマンド
$ roslaunch webjoy_example webjoy_example.launch

[0351]_★package [ropigo] nor is [ropigo] a launch file nameの対策

package [ropigo] nor is [ropigo] a launch file nameの対策

https://answers.ros.org/question/143496/roslaunch-is-neither-a-launch-file-in-package-nor-is-a-launch-file-name/
参考

pi@pi-Raspberry3:~$ 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

とエラー出たら・・・・

$ source /home/pi/catkin_ws/devel/setup.bash
のコマンドでなんとかエラー解決・・・

$ source /home/pi/gopigo_ws/devel/setup.bash
のコマンドでなんとかエラー解決・・・

$ source /home/pi/catkin_workspace/devel/setup.bash
$ source /home/pi/workspace/devel/setup.bash

以上

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

で直しておく。(2017/12/16)

[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もやった後)