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
deadprogram e828f5617d bebop: add support/example of RTP video
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-12-27 01:07:21 +01:00

39 lines
802 B
Go

/*
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()
}