moveByChanged uninitialized


I am trying to access the moveByChanged event message, but I get an error message saying that it is uninitialized.

My code:
import olympe

from olympe.messages.ardrone3.PilotingState import FlyingStateChanged, moveByChanged
from olympe.enums.ardrone3.PilotingState import MoveByChanged_Status

drone = olympe.Drone("")

    >> olympe.messages.ardrone3.PilotingState.FlyingStateChanged(state="hovering", _timeout=15)
    >>olympe.messages.ardrone3.Piloting.moveBy(1, 0, 0, 0)
    >> olympe.messages.ardrone3.PilotingState.FlyingStateChanged(state="hovering", _timeout=15)

print("Moveby changed :" ,drone.get_state(moveByChanged))

The error message happening at the last line:
RuntimeError: ardrone3.PilotingState.moveByChanged state is uninitialized

Should we not be able to access the last received moveByChanged with the .drone.get_state(…)? Have I done anything else wrong?

From my current understanding, I would guess that I have received at least two moveByChanged event messages by the time of printing, one when sending moveBy and one when the moveBy finished. I this correct?

In my log, i can’t find any received event messages named moveByChanged. Is there a way to change the verbosity level of the logging?

Anafi sends the moveByEnd event after a moveBy command.

I think that the moveByChanged message is only sent by Bebop and Bebop 2.

For Anafi, you should get the moveByEnd event only after a successful moveBy.

For an Anafi, you shouldn’t have received any moveByChanged event message.

If you really want more logs, you can increase the log level to “debug” (4).

drone = olympe.Drone("", loglevel=4)

You should then see in your logs every message received from the drone.

1 Like

Hi ndessart, thank you for the quick reply,

Would it be possible to get similar information(dX, dY and dZ) after canceling a moveBy on anafi that the moveByEnd and moveByChanged provides?

This would need an Anafi firmware update.

You should add a message to the wishlist topic created by @Jerome and explain there what you’d like to see in a future release. Thanks

Thanks again for a quick answer.

If it is not yet implemented, I fear it is to late for me. I only have until the end of the summer. :frowning:

The wishlist seemes like a good idea. :slight_smile: