Skip to main content

get_flow_y()

Description#

This getter function gets the relative position value calculated by the optical flow sensor from the y direction (left and right).
y position image

Syntax#

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

Parameters#

unit: The unit of measurement that is chosen for the 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 relative position value calculated by the optical flow sensor from the y direction. (cm default).

Example Code#
Python#
#Python code
from codrone_edu.drone import *
drone = Drone()
drone.pair()
drone.takeoff()
drone.set_roll(50)
drone.move(1)
print(drone.get_flow_y())
drone.land()
drone.close()