hybridgroup.gobot/platforms/leap
Andrew Stewart 111a6df996 Add support for 'hand' and 'gesture' Leap Motion events 2016-02-17 12:25:15 -08:00
..
test/support WIP project restructure 2014-04-29 13:20:32 -07:00
LICENSE WIP project restructure 2014-04-29 13:20:32 -07:00
README.md Corrected to proper versionindependent install 2015-07-08 15:39:50 -07:00
doc.go Update docs 2014-10-28 14:52:59 -07:00
leap_motion_adaptor.go platforms/leap: use golang.org/x/net/websocket 2015-04-16 11:08:50 +02:00
leap_motion_adaptor_test.go Increase leap test coverage 2014-12-18 15:13:53 -08:00
leap_motion_driver.go Add support for 'hand' and 'gesture' Leap Motion events 2016-02-17 12:25:15 -08:00
leap_motion_driver_test.go Increase leap test coverage 2014-12-18 15:13:53 -08:00
parser.go Increase leap test coverage 2014-11-07 13:15:45 -08:00

README.md

Leap

The Leap Motion is a user-interface device that tracks the user's hand motions, and translates them into events that can control robots and physical computing hardware.

For more info about the Leap Motion platform click Leap Motion

How to Install

First install the Leap Motion Software

Now you can install the package with:

go get -d -u github.com/hybridgroup/gobot/... && go install github.com/hybridgroup/gobot/platforms/leap

How to Use

package main

import (
	"fmt"

	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/leap"
)

func main() {
	gbot := gobot.NewGobot()

	leapMotionAdaptor := leap.NewLeapMotionAdaptor("leap", "127.0.0.1:6437")
	l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")

	work := func() {
		gobot.On(l.Event("message"), func(data interface{}) {
			fmt.Println(data.(leap.Frame))
		})
	}

	robot := gobot.NewRobot("leapBot",
		[]gobot.Connection{leapMotionAdaptor},
		[]gobot.Device{l},
		work,
	)

	gbot.AddRobot(robot)

	gbot.Start()
}

How To Connect

OSX

This driver works out of the box with the vanilla installation of the Leap Motion Software that you get in their Setup Guide.

The main steps are:

  • Run Leap Motion.app to open a websocket connection in port 6437.
  • Connect your Computer and Leap Motion Controller.
  • Connect to the device via Gobot.

Ubuntu

The Linux download of the Leap Motion software can be obtained from Leap Motion Dev Center (requires free signup)

The main steps are:

  • Run the leapd daemon, to open a websocket connection in port 6437.
  • Connect your computer and the Leap Motion controller
  • Connect to the device via Gobot