yosiyoshi / YoshiDrone

Project code: 朱雀, drone-programming project in Asia.
0 stars 0 forks source link

Exception occured in drone.py #1

Closed yosiyoshi closed 5 years ago

yosiyoshi commented 5 years ago

https://github.com/yosiyoshi/YoshiDrone/blob/master/drone.py

DJI/Ryze Tech "Tello" remoted by this program occured an exception.

As the result, the drone program couldn't work properly.

The drone seems able to take off, but has something wrong for landing, therefore the process may cause to stop before: sys.exit() in the part of:

if __name__ == '__main__':
    tap=TelloAutoPilot()
    tap.initConnection()
    tap.takeoff()
    tap.land()
    sys.exit()

Then occured:

An exception has occurred, use %tb to see the full traceback.

SystemExit

C:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2870: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

Exception-able functions are defined as below:

try:
            sent = self.sock.sendto('command'.encode(encoding="utf-8"), self.tello)
        except:
            pass
        try:
            sent = self.sock.sendto('speed 50'.encode(encoding="utf-8"), self.tello)
        except:
            pass

    def land(self):
        try:
            sent = self.sock.sendto('land'.encode(encoding="utf-8"), self.tello)
        except:
            pass
yosiyoshi commented 5 years ago

As written in article: http://juggly.cn/archives/238099.html

Ryze Python SDK seems to be unable using "land" API command for Tello. If true, this error is also existing but impossible for me to solve QAQ