Raspberry Pi 3とROSを使い,顔を発見したらCount upし,LEDを点灯するプログラムを作成した.以下,ファイル構成を示す.
launch/ - ROSのLaunch File.
scripts/count.py - 顔認識をしてCount upする.また顔を発見したらLEDを点灯し,失ったら消す.
scripts/twice.py - Countを2倍にする.
- Raspberry Pi 3
- Ubuntu 16.04
- LED
- Resistor
回路に関しては以下を参照。GPIO20 PinとGroundを接続。
$ git clone https://github.com/Ryou-Watanabe/ros_face_count.git
cv_camera,mjpeg_server等は各自インストールしてください.
launchする.
$ roslaunch ros_face_count run_face_count.launch &
顔を発見した回数を見る場合は,
$ rostopic echo /count_face
単純なcount upを見る場合は,
rostopic echo /count_up
2倍のcount upを見る場合は,
rostopic echo /twice
カメラ映像を見る場合はブラウザで以下のリンクを参照.
http://[IP Address]:10002/stream?topic=/cv_camera/image_raw