View Source Tello.Controller (Tello v0.3.0)

GenServer to connect to a Tello.

Uses Tello.start/1 to start a client.

Link to this section Summary

Functions

Fly back for distance cm.

Returns a specification to start this module under a supervisor.

Set the Tello to station mode, and connect to the access point.

Fly at a curve according to the two given coordinates of the Mission Pad mission_pad_id at speed (cm/s).

Fly down for distance cm.

Stop motors immediately.

Enable Tello's SDK mode.

Fly forward for distance cm.

Get current battery percentage.

Get Tello SDK version

Get Tello serial number

Get current speed (cm/s).

Get current flight time.

Get Wi-Fi SNR.

Fly to coordinate x,y,z at speed (cm/s).

Fly to coordinates x,y,z of Mission Pad first_mission_pad_id after recognizing, and recognize coordinates 0,0,z of Mission Pad second_mission_pad_id and rotate to the yaw value after hovering at the coordinates.

Auto landing.

Fly left for distance cm.

Fly right for distance cm.

Rotate degree degrees on direction.

Set Mission Pad detection to on/off

Set Mission Pad detection mode

Set speed to speed cm/s

Set Wi-Fi SSID and password

Hover in the air.

Set the video stream to on/off.

Auto takeoff.

Fly up for distance cm.

Link to this section Types

@type coordinate() :: {x :: integer(), y :: integer(), z :: integer()}
@type init_arg() :: [
  ip: :inet.ip_address(),
  port: :inet.port_number(),
  receiver: Tello.Controller.Receiver.t() | nil
]
@type mission_pad_id() :: :m1 | :m2 | :m3 | :m4 | :m5 | :m6 | :m7 | :m8
@type t() :: module()

Link to this section Functions

Link to this function

back(controller, distance)

View Source
@spec back(pid(), integer()) :: :ok | {:error, any()}

Fly back for distance cm.

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

connect_to_ap(controller, ssid, password)

View Source
@spec connect_to_ap(pid(), String.t(), String.t()) :: :ok | {:error, any()}

Set the Tello to station mode, and connect to the access point.

Link to this function

curve(controller, coordinate1, coordinate2, speed, mission_pad_id \\ nil)

View Source
@spec curve(pid(), coordinate(), coordinate(), integer(), mission_pad_id() | nil) ::
  :ok | {:error, any()}

Fly at a curve according to the two given coordinates of the Mission Pad mission_pad_id at speed (cm/s).

Link to this function

down(controller, distance)

View Source
@spec down(pid(), integer()) :: :ok | {:error, any()}

Fly down for distance cm.

@spec emergency(pid()) :: :ok | {:error, any()}

Stop motors immediately.

@spec enable(pid()) :: :ok | {:error, any()}

Enable Tello's SDK mode.

Link to this function

flip(controller, direction)

View Source
@spec flip(pid(), :back | :forward | :left | :right) :: :ok | {:error, any()}

Flip direction

Available direction:

  • :left
  • :right
  • forward
  • back
Link to this function

forward(controller, distance)

View Source
@spec forward(pid(), integer()) :: :ok | {:error, any()}

Fly forward for distance cm.

@spec get_battery(pid()) :: :ok | {:error, any()}

Get current battery percentage.

Link to this function

get_sdk_version(controller)

View Source
@spec get_sdk_version(pid()) :: :ok | {:error, any()}

Get Tello SDK version

Link to this function

get_serial_number(controller)

View Source
@spec get_serial_number(pid()) :: :ok | {:error, any()}

Get Tello serial number

@spec get_speed(pid()) :: :ok | {:error, any()}

Get current speed (cm/s).

@spec get_time(pid()) :: :ok | {:error, any()}

Get current flight time.

Link to this function

get_wifi_snr(controller)

View Source
@spec get_wifi_snr(pid()) :: :ok | {:error, any()}

Get Wi-Fi SNR.

Link to this function

go(controller, arg, speed, mission_pad_id \\ nil)

View Source
@spec go(pid(), coordinate(), integer(), mission_pad_id() | nil) ::
  :ok | {:error, any()}

Fly to coordinate x,y,z at speed (cm/s).

If mission_pad_id is set, the coordinates will be set of the Mission Pad.

Link to this function

jump(controller, arg, speed, yaw, first_mission_pad_id, second_mission_pad_id)

View Source
@spec jump(
  pid(),
  coordinate(),
  integer(),
  integer(),
  mission_pad_id(),
  mission_pad_id()
) :: :ok | {:error, any()}

Fly to coordinates x,y,z of Mission Pad first_mission_pad_id after recognizing, and recognize coordinates 0,0,z of Mission Pad second_mission_pad_id and rotate to the yaw value after hovering at the coordinates.

@spec land(pid()) :: :ok | {:error, any()}

Auto landing.

Link to this function

left(controller, distance)

View Source
@spec left(pid(), integer()) :: :ok | {:error, any()}

Fly left for distance cm.

Link to this function

right(controller, distance)

View Source
@spec right(pid(), integer()) :: :ok | {:error, any()}

Fly right for distance cm.

Link to this function

rotate(controller, direction, degree)

View Source
@spec rotate(pid(), :clockwise | :counterclockwise, integer()) ::
  :ok | {:error, any()}

Rotate degree degrees on direction.

Link to this function

set_mission_pad_detection(controller, toggle)

View Source
@spec set_mission_pad_detection(pid(), :off | :on) :: :ok | {:error, any()}

Set Mission Pad detection to on/off

Link to this function

set_mission_pad_detection_mode(controller, mode)

View Source
@spec set_mission_pad_detection_mode(
  pid(),
  :both | :downward | :forward
) :: :ok | {:error, any()}

Set Mission Pad detection mode

Link to this function

set_remote_controller(controller, channel_left_right, channel_forward_backward, channel_up_down, yaw)

View Source
@spec set_remote_controller(
  pid(),
  {:left, integer()} | {:right, integer()},
  {:backward, integer()} | {:forward, integer()},
  {:down, integer()} | {:up, integer()},
  integer()
) :: :ok | {:error, any()}

Set remote controller via four channels

Link to this function

set_speed(controller, speed)

View Source
@spec set_speed(pid(), integer()) :: :ok | {:error, any()}

Set speed to speed cm/s

Link to this function

set_wifi(controller, ssid, password)

View Source
@spec set_wifi(pid(), String.t(), String.t()) :: :ok | {:error, any()}

Set Wi-Fi SSID and password

@spec stop(pid()) :: :ok | {:error, any()}

Hover in the air.

Link to this function

stream(controller, toggle)

View Source
@spec stream(pid(), :on | :off) :: :ok | {:error, any()}

Set the video stream to on/off.

@spec takeoff(pid()) :: :ok | {:error, any()}

Auto takeoff.

Link to this function

up(controller, distance)

View Source
@spec up(pid(), integer()) :: :ok | {:error, any()}

Fly up for distance cm.