gobot.io/x/gobot/v2@v2.1.0/platforms/leap/README.md (about) 1 # Leap 2 3 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. 4 5 For more info about the Leap Motion platform click [Leap Motion](https://www.leapmotion.com/) 6 7 ## How to Install 8 9 First install the [Leap Motion Software](https://www.leapmotion.com/setup) 10 11 Now you can install the package with: 12 13 ``` 14 go get -d -u gobot.io/x/gobot/v2/... 15 ``` 16 17 ## How to Use 18 19 ```go 20 package main 21 22 import ( 23 "fmt" 24 25 "gobot.io/x/gobot/v2" 26 "gobot.io/x/gobot/v2/platforms/leap" 27 ) 28 29 func main() { 30 leapMotionAdaptor := leap.NewAdaptor("127.0.0.1:6437") 31 l := leap.NewDriver(leapMotionAdaptor) 32 33 work := func() { 34 l.On(l.Event("message"), func(data interface{}) { 35 fmt.Println(data.(leap.Frame)) 36 }) 37 } 38 39 robot := gobot.NewRobot("leapBot", 40 []gobot.Connection{leapMotionAdaptor}, 41 []gobot.Device{l}, 42 work, 43 ) 44 45 robot.Start() 46 } 47 ``` 48 49 ## How To Connect 50 51 ### OSX 52 53 This driver works out of the box with the vanilla installation of the Leap Motion Software that you get in their [Setup Guide](https://www.leapmotion.com/setup). 54 55 The main steps are: 56 57 * Run Leap Motion.app to open a websocket connection in port 6437. 58 * Connect your Computer and Leap Motion Controller. 59 * Connect to the device via Gobot. 60 61 ### Ubuntu 62 63 The Linux download of the Leap Motion software can be obtained from [Leap Motion Dev Center](https://developer.leapmotion.com/downloads) (requires free signup) 64 65 The main steps are: 66 67 * Run the leapd daemon, to open a websocket connection in port 6437. 68 * Connect your computer and the Leap Motion controller 69 * Connect to the device via Gobot