Basic AutoScript Functions

AutoScript has some basic functions for accessing drone navigation data and controlling flight. On this page, these built-in functions are documented.


In AutoFlight 1.0, the AutoScript API has changed and is not compatible with earlier versions of AutoFlight.

They are divided into two modules named basicctl and imgproc. The imgproc module contains functions for retrieving and processing images, while the basicctl module is used for most other simple commands.

For more advanced and high-level commands, please use the dronectl package.

Basic control and navigation data retrieval


Sends a take off command to the drone. This will only send the command and continue immediately, so you’ll probably want to wait until the drone has fully taken off.

Sends a land command to the drone.

basicctl.move(pitch, roll, gaz, yaw)

Moves the drone by setting the pitch and roll angles as well as vertical and rotational speed.


This function will cause the drone to move with the specified parameters for an infinite amount of time. You will need to call the hover() command to stop it.

  • pitch – Pitch angle in radians (positive is backward, negative is forward)
  • roll – Roll angle in radians (positive is right, negative is left)
  • gaz – Vertical speed in m/s (positive is up, negative is down)
  • yaw – Rotational speed in rad/s (positive is clockwise, negative is counterclockwise)
basicctl.move_rel(pitch, roll, gaz, yaw)

Moves the drone. The parameters are multipliers of the allowed maximum, and have to be in the range from -1.0 (corresponding to the maximum tilt in one direction) to 1.0 (corresponding to the maximum in the other direction).


This function will cause the drone to move with the specified parameters for an infinite amount of time. You will need to call the hover() command to stop it.

  • pitch – Pitch angle (-1.0: full speed in forward direction; 1.0: full speed in backward direction)
  • roll – Roll angle (-1.0: full angle to left hand side; 1.0: full angle to right hand side)
  • gaz – Vertical speed (-1.0: full speed down; 1.0: full speed up)
  • yaw – Rotational speed (-1.0: full speed in counterclockwise direction; 1.0: full speed in clockwise direction)

Hovers the drone, so it tries to stay at a fixed position. Equivalent to calling move(0, 0, 0, 0).


Sends the flip command to the drone.

Parameters:direction"FRONT", "BACK", "LEFT" or "RIGHT"

Retrieve the navigation data.

Returns:A dict containing all of the available navigation data. Can vary depending on the drone type (AR.Drone 2.0 or Bebop). Will be empty if not connected.

Retrieve the drone’s status.

Returns:A dict containing three keys: 'connected', 'armed' and 'flying'.

Perform a “flat trim”.

basicctl.set_view(tilt, pan)

On the Bebop drone, this sets the direction of the digital gimbal.

  • tilt – Tilt between -100 and 100.
  • pan – Pan between -100 and 100.

Start recording.


Stop recording.


Switch between front and bottom view. On the AR.Drone 2.0 this switches between the front and bottom camera. On the Bebop this changes the view of the digital gimbal.

Parameters:view – “TOGGLE” to toggle between front/bottom, “FRONT” to look front, “BOTTOM” to look down.

Take a picture.

Image Processing


Using OpenCV’s built in GUI functionality is not (yet) possible in AutoFlight. To display an image, you should always use imgproc.showFrame(img) and never OpenCV’s imshow() or similar.


I am still refining the image processing capabilities of AutoScript. Right now it is possible to retrieve images, to process them using OpenCV for Python, to display them in the AutoFlight main window and to use the April Tag detector built into AutoFlight.


Get the latest frame.

Returns:A numpy array containing the latest received video frame in 8-bit 3 channel BGR format.

Get the age of the latest frame. Useful for ignoring outdated frames when the video feed is interrupted.

Returns:The age of the latest frame, in milliseconds.

Show an image in the AutoFlight main window.

Parameters:frame – A numpy array containing the frame to display. Must be 8-bit 3 channel BGR or binary.

Start the integrated April tag detector.


Stop the integrated April tag detector.


Tell the tag detector which April tag family you want to detect.

Parameters:family – The name of the tag family (e.g.: "Tag36h11")
imgproc.set_tag_roi(x, y, width, height)

Set the rectangular region of interest for the tag detector. Only this region will be analyzed when running the tag detector, potentially reducing CPU usage significantly.

  • x – X-coordinate of the upper left point of your ROI
  • y – Y-coordinate of the upper left point of your ROI
  • width – Width of the ROI
  • height – Height of the ROI

Get the detected tags.

Returns:A list of tuples, each tuple representing one detected tag. Each tuple contains the tag’s ID, a flag indicating whether the detection is valid or not and a list of X/Y coordinates of the tag’s edges.