Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from plindborg/master
Added getting started info into Readme.md
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
ardrone | ||
======= | ||
|
||
A Go implementation of the Parrot AR Drone protocols. | ||
|
||
|
||
Get the latest version from Github | ||
```bash | ||
go get github.com/felixge/ardrone | ||
``` | ||
|
||
|
||
Simple testcode to get the drone to takeof and land: | ||
```js | ||
package main | ||
|
||
import ( | ||
"log" | ||
"github.com/felixge/ardrone" | ||
/*"net"*/ | ||
"time" | ||
) | ||
|
||
func main() { | ||
log.SetFlags(log.Lmicroseconds) | ||
client := &ardrone.Client{Config: ardrone.DefaultConfig()} | ||
|
||
start := time.Now() | ||
|
||
log.Printf("Connecting to: %+v ...\n", client) | ||
|
||
err := client.Connect() | ||
if err != nil { | ||
log.Fatal(err) | ||
return | ||
} | ||
|
||
log.Printf("Ready! Took %s\n", time.Since(start)) | ||
|
||
start = time.Now() | ||
|
||
err = client.Takeoff() | ||
if err != nil { | ||
log.Fatal(err) | ||
return | ||
} | ||
|
||
log.Printf("Takeoff %s\n", time.Since(start)) | ||
|
||
start = time.Now() | ||
|
||
err = client.Land() | ||
if err != nil { | ||
log.Fatal(err) | ||
return | ||
} | ||
|
||
log.Printf("Land %s\n", time.Since(start)) | ||
} | ||
``` | ||
Save the code into a file and run | ||
```bash | ||
go build main.go | ||
``` | ||
|
||
Then run | ||
```bash | ||
./go | ||
``` | ||
|
||
|