amymcgovern / pyparrot

Python interface for Parrot Drones
MIT License
276 stars 129 forks source link

Parrot Bebop 1 issues #154

Open ahafeez8 opened 5 years ago

ahafeez8 commented 5 years ago

I initially had problem establishing WiFi connection as it was picking mdns_address for Bebop 2 not Bebop. One of the issues mentioned to change the mdns_address from _arsdk-090c._udp.local. to _arsdk-0901._udp.local.

So I changed the ``` elif (drone_type is "Bebop2"): self.mdns_address = "_arsdk-090c._udp.local."

to

elif (drone_type is "Bebop2"):
            self.mdns_address = "_arsdk-0901._udp.local.

I am not sure if it was a sensible thing to do but it got me connected to the bebop in any case. However, now I am trying to call self_takeoff, it returns true but does not takes off. Same for any other commands given to bebop. I am using following code:

from pyparrot.Bebop import Bebop

bebop = Bebop()

print("connecting")
success = bebop.connect(30)
print(success)
print("sleeping")

bebop.smart_sleep(5)

bebop.ask_for_state_update()

bebop.safe_takeoff(10)
print("flip left")
print("flying state is %s" % bebop.sensors.flying_state)
success = bebop.flip(direction="left")
print("bebop flip result %s" % success)
bebop.smart_sleep(5)

bebop.smart_sleep(5)
bebop.safe_land(10)

print("DONE - disconnecting")
bebop.disconnect()
amymcgovern commented 5 years ago

You need to tell it what type of Bebop you are when you create the Bebop object.

drone_type="Bebop2" is the default.

That will take care of your issue connecting.