1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-26 13:48:49 +08:00
hybridgroup.gobot/examples/bebop_rtp_video.go
Marc-Antoine Ruel 50d5869808 Fix go test ./...
Make all examples to not be built by default by adding the build tag 'example'.
Some files were automatically reformatted by goimports upon saving.
2017-03-13 11:01:39 -04:00

43 lines
852 B
Go

// +build example
//
// Do not build by default.
/*
This example will connect to the Parrot Bebop and streams the drone video
via the RTP protocol.
In order to run this example you will first need to connect to the drone with:
$ go run bebop_ps3_video.go
then in a separate terminal run this program:
$ mplayer examples/bebop.sdp
You can view the video feed by navigating to
http://localhost:8090/bebop.mjpeg in a web browser.
*NOTE* firefox works best for viewing the video feed.
*/
package main
import (
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/parrot/bebop"
)
func main() {
bebopAdaptor := bebop.NewAdaptor()
drone := bebop.NewDriver(bebopAdaptor)
work := func() {
drone.VideoEnable(true)
}
robot := gobot.NewRobot("drone",
[]gobot.Connection{bebopAdaptor},
[]gobot.Device{drone},
work,
)
robot.Start()
}