gobot.io/x/gobot/v2@v2.1.0/platforms/parrot/bebop/README.md (about)

     1  # Bebop
     2  
     3  The Parrot Bebop and Parrot Bebop 2 are inexpensive quadcopters that can be controlled using their built-in API commands via a WiFi connection. They include a built-in front-facing HD video camera, as well as a second lower resolution bottom-facing video camera.
     4  
     5  ## How to Install
     6  ```
     7  go get -d -u gobot.io/x/gobot/v2/...
     8  ```
     9  
    10  ## How to Use
    11  ```go
    12  package main
    13  
    14  import (
    15  	"time"
    16  
    17  	"gobot.io/x/gobot/v2"
    18  	"gobot.io/x/gobot/v2/platforms/parrot/bebop"
    19  )
    20  
    21  func main() {
    22  	bebopAdaptor := bebop.NewAdaptor()
    23  	drone := bebop.NewDriver(bebopAdaptor)
    24  
    25  	work := func() {
    26      drone.HullProtection(true)
    27  		drone.TakeOff()
    28  		gobot.On(drone.Event("flying"), func(data interface{}) {
    29  			gobot.After(3*time.Second, func() {
    30  				drone.Land()
    31  			})
    32  		})
    33  	}
    34  
    35  	robot := gobot.NewRobot("drone",
    36  		[]gobot.Connection{bebopAdaptor},
    37  		[]gobot.Device{drone},
    38  		work,
    39  	)
    40  
    41  	robot.Start()
    42  }
    43  ```
    44  
    45  ## How to Connect
    46  
    47  By default, the Parrot Bebop is a WiFi access point, so there is no additional work to establish a connection to a single drone, you just connect to it.
    48  
    49  Once connected, if you want to stream drone video you can either:
    50  
    51  	- Use the RTP protocol with an external player such as mplayer or VLC.
    52  	- Grab the video frames from the drone's data frames, and work with them directly.