Skip to content

Commit

Permalink
Change default value for PCMD flag to match the Bebop 2.0.57+ expecta…
Browse files Browse the repository at this point in the history
…tions

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Apr 12, 2016
1 parent e44c014 commit f1239d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 10 additions & 2 deletions platforms/bebop/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func New() *Bebop {
DiscoveryPort: 44444,
networkFrameGenerator: networkFrameGenerator(),
Pcmd: Pcmd{
Flag: 1,
Flag: 0,
Roll: 0,
Pitch: 0,
Yaw: 0,
Expand Down Expand Up @@ -382,48 +382,56 @@ func (b *Bebop) Land() error {
}

func (b *Bebop) Up(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Gaz = validatePitch(val)
return nil
}

func (b *Bebop) Down(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Gaz = validatePitch(val) * -1
return nil
}

func (b *Bebop) Forward(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Pitch = validatePitch(val)
return nil
}

func (b *Bebop) Backward(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Pitch = validatePitch(val) * -1
return nil
}

func (b *Bebop) Right(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Roll = validatePitch(val)
return nil
}

func (b *Bebop) Left(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Roll = validatePitch(val) * -1
return nil
}

func (b *Bebop) Clockwise(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Yaw = validatePitch(val)
return nil
}

func (b *Bebop) CounterClockwise(val int) error {
b.Pcmd.Flag = 1
b.Pcmd.Yaw = validatePitch(val) * -1
return nil
}

func (b *Bebop) Stop() error {
b.Pcmd = Pcmd{
Flag: 1,
Flag: 0,
Roll: 0,
Pitch: 0,
Yaw: 0,
Expand Down
3 changes: 0 additions & 3 deletions platforms/bebop/client/examples/takeoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ func main() {
return
}

fmt.Println("hull")
bebop.HullProtection(true)
//fmt.Println("outdoor")
//bebop.Outdoor(false)

fmt.Println("takeoff")
if err := bebop.TakeOff(); err != nil {
Expand Down

0 comments on commit f1239d4

Please sign in to comment.