ANAFI drone doesn't hold position

When I fly the drone with the Skycontroller3, everything works fine. However, when I control the drone programmatically, the drone will not hold position while in hovering mode, it drifts backwards or forwards and doesn’t try to correct it’s position. I didn’t attach code because I just used the code from the example in the Olympe User Guide. This behavior does not exist in the Sphinx simulation of the same script. Any ideas would be appreciated,

Thanks!

The code is a simple moveBy command to tell the drone to rotate 180 degrees.

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

The drone performs all the commands, but drifts during the turn. If I turn the drone with the Skycontroller3, there is no drift. Any thoughts?

Hi,

When the drone drifts (with Olympe) is it an indoor flight ? That would explain the difference if you fly outdoor with the SkyCtrl.

Why don’t you install Sphinx ? Please don’t answer here but if you have any problem using Sphinx create a new thread instead. Thanks

1 Like