hybridgroup.gobot/platforms/leap
deadprogram 1513af3fa6 docs: Add missing godocs for Leap Motion platform
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-12-02 00:01:37 +01:00
..
test/support WIP project restructure 2014-04-29 13:20:32 -07:00
LICENSE misc: update all LICENSE files for current year 2016-08-27 13:12:47 +02:00
README.md docs: remove Master unless needed for less code 2016-10-18 21:37:10 +02:00
doc.go docs: remove Master unless needed for less code 2016-10-18 21:37:10 +02:00
leap_motion_adaptor.go docs: Add missing godocs for Leap Motion platform 2016-12-02 00:01:37 +01:00
leap_motion_adaptor_test.go core: update leap Motion platform to simply return error 2016-11-07 21:29:52 +01:00
leap_motion_driver.go docs: Add missing godocs for Leap Motion platform 2016-12-02 00:01:37 +01:00
leap_motion_driver_test.go core: update leap Motion platform to simply return error 2016-11-07 21:29:52 +01:00
parser.go docs: Add missing godocs for Leap Motion platform 2016-12-02 00:01:37 +01: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() {
	leapMotionAdaptor := leap.NewAdaptor("127.0.0.1:6437")
	l := leap.NewDriver(leapMotionAdaptor)

	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,
	)

	robot.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