platforms/leap/README.md
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
Please refer to the main README.md
First install the Leap Motion Software
package main
import (
"fmt"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/platforms/leap"
)
func main() {
leapMotionAdaptor := leap.NewAdaptor("127.0.0.1:6437")
l := leap.NewDriver(leapMotionAdaptor)
work := func() {
l.On(l.Event("message"), func(data interface{}) {
fmt.Println(data.(leap.Frame))
})
}
robot := gobot.NewRobot("leapBot",
[]gobot.Connection{leapMotionAdaptor},
[]gobot.Device{l},
work,
)
if err := robot.Start(); err != nil {
panic(err)
}
}
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:
The Linux download of the Leap Motion software can be obtained from Leap Motion Dev Center (requires free signup).
The main steps are: