Change default value for PCMD flag to match the Bebop 2.0.57+ expectations

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2016-04-12 14:27:30 -07:00
parent e44c014e54
commit f1239d42a0
2 changed files with 10 additions and 5 deletions

View File

@ -179,7 +179,7 @@ func New() *Bebop {
DiscoveryPort: 44444,
networkFrameGenerator: networkFrameGenerator(),
Pcmd: Pcmd{
Flag: 1,
Flag: 0,
Roll: 0,
Pitch: 0,
Yaw: 0,
@ -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,

View File

@ -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 {