Golang と Leapmotion. first step #golangjp

golangとLeapmotion

Gobot使ってみる。

Gobot is a framework for robotics, physical computing, and the Internet of Things, written in the Go programming language

Document

Godoc

  • http://godoc.org/github.com/hybridgroup/gobot
  • http://godoc.org/github.com/hybridgroup/gobot/platforms/leap

とりあえず、ログを取るだけで良ければ以下のページの手順に従う。

  • http://gobot.io/documentation/platforms/leapmotion/

```

{115.216 [] [{[-0.297625 -0.612242 -0.732516] 408 [-0.0616006 -0.753372 0.654703] [65.6295 103.284 -20.7797] [-48.1351 56.8038 -68.9287] [[0.862746 -0.102846 -0.495068] [-0.453123 0.277236 -0.847242] [0.224386 0.955282 0.192583]] 0.734817 [95.3671 10.8633 26.1925] 107.394 [65.61 103.041 -20.225] [26.7724 -79.464 -60.8875] 1.32673}] 1222684 {[0 200 0] [235.247 235.247 147.751]} [{[-0.405926 -0.836996 -0.366963] 408 4080 49.5853 [7.28188 67.1076 -7.91108] 1.32673 [6.85502 67.2503 -8.43044] [10.6799 -15.7471 -22.8067] false 0.396117 hovering} {[-0.234081 -0.971834 -0.0272965] 408 4081 55.9515 [16.9302 29.3999 -50.0191] 1.32673 [17.2568 28.0323 -49.9886] [-6.9051 -25.2343 -51.8481] false 0.332947 hovering}] [[0.862746 -0.102846 -0.495068] [-0.453123 0.277236 -0.847242] [0.224386 0.955282 0.192583]] 0.734817 [26.7724 -79.464 -60.8875] 30739071629}

```

こんなかんじのログがとれたりする、これだけだとイミフなので、下記構造体でParseしてよしなにやっていくことになる。

その他、Gobotにあったサンプルコード

取得出来る構造体は github.com/hybridgroup/gobot/platforms/leap のparser.goを見とく

  • CurrentFrameRate
  • Gestures
  • Hands
  • InteractionBox
  • Pointables

HandにはXYZを取得できる関数がある(PalmPosition[]の0,1,2を返してる)

とりあえずここまで。

0 件のコメント :