Parrot-Developers/olympe

Error during drone.connect()

Closed this issue · 5 comments

When trying to simply connect to the drone (using drone.connect()) i get the error listed below
Note:

  • I get this error both using a simulator (Anafi) and a real drone (parrot bebop 2)
  • I'm running the script into a docker container, whose image derives from Python 3.6
2020-03-30 15:12:06,338 [INFO] 	olympe.drone - _connecting_cb - Connecting to device: ANAFI-0000000
2020-03-30 15:12:06,339 [INFO] 	olympe.drone - _connection_impl - Connection in progress...
2020-03-30 15:12:06,339 [INFO] 	olympe.drone.ANAFI-0000000 - _connected_cb - Connected to device: ANAFI-0000000
2020-03-30 15:12:06,340 [INFO] 	olympe.drone.ANAFI-0000000 - _connected_cb - {'json': {'c2d_port': 2233,
          'c2d_update_port': 51,
          'c2d_user_port': 21,
          'proto_v': 1,
          'qos_mode': 0,
          'status': 0}}
2020-03-30 15:12:06,342 [INFO] 	olympe.media.ANAFI-0000000 - _create_pomp_loop - Creating pomp loop
2020-03-30 15:12:06,343 [ERROR] 	olympe.drone.ANAFI-0000000 - __call__ - Unhandled exception
Traceback (most recent call last):
  File "/usr/src/app/code/parrot-groundsdk/packages/olympe/src/olympe/_private/__init__.py", line 104, in __call__
    return self.func(*args, **kwargs)
  File "/usr/src/app/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py", line 261, in _connected_cb
    scheduler=self._scheduler
  File "/usr/src/app/code/parrot-groundsdk/packages/olympe/src/olympe/media.py", line 1260, in __init__
    max_parallel_processing=self.pool_maxsize,
  File "/usr/src/app/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/expectations.py", line 374, in decorate
    namespace
TypeError: __class__ assignment: 'MediaScheduler' object layout differs from 'DefaultScheduler'
2020-03-30 15:12:11,338 [ERROR] 	olympe.drone.ANAFI-0000000 - connect - connection time out for device: b'10.202.0.1'
2020-03-30 15:12:11,347 [INFO] 	olympe.drone.ANAFI-0000000 - _disconnected_cb - Disconnected from device: ANAFI-0000000

Thanks in advance for the help

I'm intrigued!
Inside your container, what is the output of python3 --version
Can you point me to your Python 3.6 (base) docker image?
Can you please share your script? (I know your script is unlikely to be causing this)
Also unlikely but is it possible you've modified Olympe in any way ?
Please retry with media_autoconnect set to false (olympe.Drone(<anafi_ip>, media_autoconnect=False))

Thanks

Here all the info!

  • I just updated the version of Python image to 3.8 (but it shouldn't make any difference), so the output of python --version is the following: Python 3.8.2

  • The docker base image is the official one: https://hub.docker.com/_/python

  • My script is very simple, taken from the "User Guide" section of the documentation:

# -*- coding: UTF-8 -*-
from __future__ import print_function  # python2/3 compatibility for the print function
import olympe
import time
from olympe.messages.ardrone3.Piloting import TakeOff, moveBy, Landing
from olympe.messages.ardrone3.PilotingState import FlyingStateChanged

drone = olympe.Drone("10.202.0.1")
#drone = olympe.Drone("192.168.42.1")
drone.connect()
drone(
    TakeOff()
    >> FlyingStateChanged(state="hovering", _timeout=5)
).wait()
drone(
    moveBy(10, 0, 0, 0)
    >> FlyingStateChanged(state="hovering", _timeout=5)
).wait()
drone(Landing()).wait()
drone.disconnect()
  • I did not modify Olympe

  • I tried with media_autoconnect=False and yes, the script works with the simulator!

Hope this helps

Alright, I have tested Olympe with Python 3.8 and was able to reproduce this issue.
I've submitted a draft PR in #15 that will be included in the next GroundSDK/Olympe release (1.2.1).

Please let me know if that works for you. Thanks

I can confirm that the same python script works perfectly on that version of Olympe.

Thank you!

This has been fixed in Olympe 1.2.1