Moveby.py script returns an assertion error

I’m trying to run this script from the user guide, but I get an Assertion Error:

import olympe
import os
from olympe.messages.ardrone3.Piloting import TakeOff, moveBy, Landing
from olympe.messages.ardrone3.PilotingState import FlyingStateChanged

DRONE_IP = os.environ.get("DRONE_IP", "10.202.0.1")


def test_moveby2():
    drone = olympe.Drone(DRONE_IP)
    drone.connect()
    assert drone(
        TakeOff()
        >> FlyingStateChanged(state="hovering", _timeout=5)
    ).wait().success()
    assert drone(
        moveBy(10, 0, 0, 0)
        >> FlyingStateChanged(state="hovering", _timeout=5)
    ).wait().success()
    assert drone(Landing()).wait().success()
    drone.disconnect()


if __name__ == "__main__":
    test_moveby2()

but I get this Error :

Traceback (most recent call last):
  File "/home/escaper/code/parrot-groundsdk/my-script.py", line 25, in <module>
    test_moveby2()
  File "/home/escaper/code/parrot-groundsdk/my-script.py", line 12, in test_moveby2
    assert drone(
AssertionError

Hi escaper01, I get this same error when I use: parrot-ue4-industrial-city (version 2.5.1), and was able to avoid it increasing the timeout to 10.
However on: parrot-ue4-empty (version 2.6) I don get the error (I am using Ubuntu 18.04.6)
I recommend that you check the version of the 3D scenes you are using.
Hope it helps, best regards

1 Like

Update: I have updated parrot-ue4-industrial-city and the error still happens with timeout=5.
Hence it is not related to the version, to avoid the error just increase the timeout, 7 is doing the trick for me.

This topic was automatically closed after 30 days. New replies are no longer allowed.