At its core, Olympe basically just send and receive ARSDK messages to control a drone. The following sequence diagram shows what is happening when an Olympe scripts sends a TakeOff() command to a drone.

blockdiag Olympe Drone TakeOff() FlyingStateChanged(state='motor_ramping') FlyingStateChanged(state='takingoff')

Take off command sequence#

When Olympe sends a command message like the TakeOff() message above, it then waits for a response from the drone, the FlyingStateChanged(state="takingoff") event message in this case.

Sometimes, the drone can also spontaneously notify its controller (Olympe) of a particular event. Olympe provides a way to monitor such events (or a combination of such events). The following sequence diagram illustrates this scenario with a GPSFixStateChanged(0) that informs Olympe that the GPS fix has been lost.

blockdiag Olympe Drone GPSFixStateChanged(0)

Losing the GPS fix#

As a user of Olympe, you might also be punctually interested in the current state of the drone without monitoring every received message from the drone. To do this, Olympe just remembers the last received event that provides this state information and expose this information through the olympe.Drone.get_state() method.

blockdiag Olympe Drone GPSFixStateChanged(0) get_state

Getting current GPS fix status#

As demonstrated in the following usage examples, Olympe provides a relatively simple API to perform the above actions (and much more) using the following olympe.Drone class methods:

ARSDK message Python types are available in the olympe.messages.<feature_name>[.<class_name>] modules. Likewise, ARSDK enum Python types are available in the olympe.enums.<feature_name>[.<class_name>] modules.

See the Messages Reference Documentation for more information.