Skip to content

whoisjake/gomotion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gomotion

Gomotion is a framework that uses the WebSocket protocol to communicate with a LeapMotion device.

baby-gopher

Features

  • Dead simple to use.
  • Frame collection happens concurrently
  • JSON comes back parsed and placed into structs for handling.

Docs

http://godoc.org/github.com/whoisjake/gomotion

To use

In your $GOPATH:

$ cd $GOPATH
$ go get github.com/whoisjake/gomotion

And then: import "github.com/whoisjake/gomotion"

Example

package main

import (
	"github.com/whoisjake/gomotion"
	"log"
	"runtime"
)

func main() {
	// Get a device.
	runtime.GOMAXPROCS(runtime.NumCPU())
	device, err := gomotion.GetDevice("ws://127.0.0.1:6437/v3.json")
	if err != nil {
		log.Fatal(err)
	}
	device.Listen()
	defer device.Close()
	for frame := range device.Pipe {
		log.Printf("%+v\n", frame)
	}
}

About

A Leap Motion web socket consumer written in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages