Skip to main content

get_pos_z()

Description#

Getter function that gets the z position of the drone. (z is up and down)
z position image

Syntax#

get_pos_z()
get_pos_z(unit="<cm, in, mm, m>)

Parameters#

unit: The unit of measurement that is chosen for the position distance. Available units are "m" (meter), "cm" (centimeter), "mm" (millimeter), or "in" (inch). If a parameter is not specified cm is chosen by default.

Returns#

The current z position of the drone.

Example Code#
Python#
#Python code
from codrone_edu.drone import *
drone = Drone()
drone.pair()
drone.takeoff()
print(drone.get_pos_z())
drone.land()
drone.close()