2016年7月30日 星期六

神魔之塔之外理外掛

起因是看到這篇文章

https://www.youtube.com/watch?v=gMySGU0J7Ss

覺得這個網友真是太強大了...太牛逼了.....

剛好資策會的嵌式入軟體班也要做專題.....不如就來做這個吧...

一開始我們是先用 rpi 來打造 prototype....




攝影機是買羅技的C310....      然後採用 rpi3 來當作處理器.... 至於機構則是用這台

https://world.taobao.com/item/45674397950.htm?fromSite=main&spm=a312a.7700846.0.0.ObHdmq&_u=v2bnm38c3a30


這邊是我們的Demo 影片...  由於我們後來也有移植到android 系統上...所以有兩個版本的demo

android :  https://www.youtube.com/watch?v=_igjvJaxMZ8

rpi       :    https://www.youtube.com/watch?v=yaF_8Ga6jjo


===============================================================
然後整個系統主要是分成3個部分...

1.  電腦視覺

2.  轉機演算法

3.  機構驅動

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

電腦視覺:


這邊大概就是install opencv...   然後從 video_device 擷取照片...

然後利用原本已經存在資料庫的圖片進行比對...  可以參考下圖



最主要是利用templatematch ()這個api   來進行比對.....

在這個步驟完...可以得到一個   2D array ... 然後裡面代表每個格子的珠號...例如:  紅色機子是1

號,  黃色珠子是4號....紫色珠子是5號...等等...

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

轉珠演算法:

     請看下面這張圖片

 


最主要是靠BFS 的演算法來計算有幾個combo..  就是圖中的分數演算法.....

利用BFS可以找到這條路徑上所有的點的特性....

得到分數最高的路徑之後....就可以準備計算路徑並且生成G code

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

機構驅動

 


大概的做法就是如上面這張圖所示......     利用Grbl 的G code format 來傳送命令...

ex:    G0   x300     ->   往x軸的正方向移動300mm.....

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


如果有任何問題...歡迎寫信給我...    jacky.chi.0328@gmail.com
   

深度學習資料收集

Ref : https://panx.asia/archives/53209

2016年7月26日 星期二

Ref : http://www.raspberrypiblog.com/2012/10/how-to-setup-remote-desktop-from.html



  windows pc 用遠端桌面來遙控rpi...

 rpi 只需要安裝 sudo apt-get install xrdp



advanced ip scaner  

http://filehippo.com/zh/download_advanced_ip_scanner/?utm_source=ft&utm_medium=redirect&utm_campaign=ais

2016年6月23日 星期四

build openkincet in raspberry


sudo apt-get install git-core cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev
git clone git://github.com/OpenKinect/libfreenect.git
cd libfreenect
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib64/
sudo freenect-glview


core.c
#include "libfreenect.h"
FREENECTAPI int freenect_init(freenext_context **ctx, freenect_usb_context *usb_ctx);

#include "libfreenect.h"
FREENECTAPI int freenect_shutdown(freenect_context *ctx);

#include "libfreenect.h"
FREENECTAPI int freenect_process_events(freenect_context *ctx);

#include "libfreenect.h"
FREENECTAPI int freenect_num_devices(freenect_context *ctx);

#include "libfreenect.h"
FREENECTAPI int freenect_open_device(freenect_context *ctx,
                                     freenect_device **dev,
                                     int index);

#include "libfreenect.h"
FREENECTAPI int freenect_close_device(freenect_device *dev);

#include "libfreenect.h"
FREENECTAPI void freenect_set_user(freenect_device *dev, void *user);

#include "libfreenect.h"
FREENECTAPI void *freenect_get_user(freenect_device *dev);

#include "libfreenect.h"
FREENECTAPI void freenect_set_log_level(freenect_context *ctx, freenect_loglevel level);

#include "libfreenect.h"
FREENECTAPI void freenect_set_log_callback(freenect_context *ctx, freenect_log_cb cb);

fn_log()
tilt.c
freenect_get_tilt_state()
freenect_update_tilt_state()
freenect_set_tilt_degs()
freenect_set_led()
freenect_get_tilt_degs()
freenect_get_tilt_status()
freenect_get_mks_accel()
cameras.c
stream_process()
stream_init()
stream_freebufs()
stream_setbuf()
convert_packed_to_16bit()
convert_packed_to_8bit()
convert_packed11_to_16bit()
depth_process()
convert_uyuy_to_rgb()
convert_bayer_to_rgb()
video_process()
send_cmd()
write_register()
freenect_start_depth()
freenect_start_video()
freenect_stop_depth()
freenect_stop_video()
freenect_set_depth_callback()
freenect_set_video_callback()
freenect_get_video_mode_count()
freenect_get_video_mode()
freenect_get_current_video_mode()
freenect_find_video_mode()
freenect_set_video_mode()
freenect_get_depth_mode_count()
freenect_get_depth_mode()
freenect_get_current_depth_mode()
freenect_find_depth_mode()
freenect_set_depth_mode()
freenect_set_depth_buffer()
freenect_set_video_buffer()


Ref : https://openkinect.org/wiki/Getting_Started

Ref : https://github.com/OpenKinect/libfreenect

Ref : https://openkinect.org/wiki/Protocol_Documentation

ref : https://openkinect.org/wiki/Low_Level

Node-RED 三輪車, 就是要來玩物聯網應用的




Ref : http://gogoprivateryan.blogspot.tw/2016/06/node-red-ibm-watson-iot-platform-node.html