Classes | Functions | Variables
tellopy.examples.keyboard_and_video Namespace Reference

Classes

class  FlightDataDisplay
 

Functions

def flight_data_mode (drone, args)
 
def flight_data_recording (args)
 
def flightDataHandler (event, sender, data)
 
def handleFileReceived (event, sender, data)
 
def main ()
 
def palm_land (drone, speed)
 
def status_print (text)
 
def take_picture (drone, speed)
 
def toggle_recording (drone, speed)
 
def toggle_zoom (drone, speed)
 
def update_hud (hud, drone, flight_data)
 
def videoFrameHandler (event, sender, data)
 

Variables

dictionary controls
 
string date_fmt = '%Y-%m-%d_%H%M%S'
 
 font = None
 
list hud
 
 prev_flight_data = None
 
 video_player = None
 
 video_recorder = None
 
 wid = None
 

Detailed Description

tellopy sample using keyboard and video player

Requires mplayer to record/save video.


Controls:
- tab to lift off
- WASD to move the drone
- space/shift to ascend/descent slowly
- Q/E to yaw slowly
- arrow keys to ascend, descend, or yaw quickly
- backspace to land, or P to palm-land
- enter to take a picture
- R to start recording video, R again to stop recording
  (video and photos will be saved to a timestamped file in ~/Pictures/)
- Z to toggle camera zoom state
  (zoomed-in widescreen or high FOV 4:3)

Function Documentation

def tellopy.examples.keyboard_and_video.flight_data_mode (   drone,
  args 
)

Definition at line 141 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.flight_data_recording (   args)

Definition at line 144 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.flightDataHandler (   event,
  sender,
  data 
)

Definition at line 177 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.handleFileReceived (   event,
  sender,
  data 
)

Definition at line 206 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.main ( )

Definition at line 216 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.palm_land (   drone,
  speed 
)

Definition at line 74 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.status_print (   text)

Definition at line 165 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.take_picture (   drone,
  speed 
)

Definition at line 69 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.toggle_recording (   drone,
  speed 
)

Definition at line 43 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.toggle_zoom (   drone,
  speed 
)

Definition at line 79 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.update_hud (   hud,
  drone,
  flight_data 
)

Definition at line 147 of file keyboard_and_video.py.

def tellopy.examples.keyboard_and_video.videoFrameHandler (   event,
  sender,
  data 
)

Definition at line 184 of file keyboard_and_video.py.

Variable Documentation

dictionary tellopy.examples.keyboard_and_video.controls
Initial value:
1 = {
2  'w': 'forward',
3  's': 'backward',
4  'a': 'left',
5  'd': 'right',
6  'space': 'up',
7  'left shift': 'down',
8  'right shift': 'down',
9  'q': 'counter_clockwise',
10  'e': 'clockwise',
11  # arrow keys for fast turns and altitude adjustments
12  'left': lambda drone, speed: drone.counter_clockwise(speed*2),
13  'right': lambda drone, speed: drone.clockwise(speed*2),
14  'up': lambda drone, speed: drone.up(speed*2),
15  'down': lambda drone, speed: drone.down(speed*2),
16  'tab': lambda drone, speed: drone.takeoff(),
17  'backspace': lambda drone, speed: drone.land(),
18  'p': palm_land,
19  'r': toggle_recording,
20  'z': toggle_zoom,
21  'enter': take_picture,
22  'return': take_picture,
23 }

Definition at line 93 of file keyboard_and_video.py.

string tellopy.examples.keyboard_and_video.date_fmt = '%Y-%m-%d_%H%M%S'

Definition at line 41 of file keyboard_and_video.py.

tellopy.examples.keyboard_and_video.font = None

Definition at line 39 of file keyboard_and_video.py.

list tellopy.examples.keyboard_and_video.hud
Initial value:
1 = [
2  FlightDataDisplay('height', 'ALT %3d'),
3  FlightDataDisplay('ground_speed', 'SPD %3d'),
4  FlightDataDisplay('battery_percentage', 'BAT %3d%%'),
5  FlightDataDisplay('wifi_strength', 'NET %3d%%'),
6  FlightDataDisplay(None, 'CAM %s', update=flight_data_mode),
7  FlightDataDisplay(None, '%s', colour=(255, 0, 0), update=flight_data_recording),
8 ]

Definition at line 168 of file keyboard_and_video.py.

tellopy.examples.keyboard_and_video.prev_flight_data = None

Definition at line 36 of file keyboard_and_video.py.

tellopy.examples.keyboard_and_video.video_player = None

Definition at line 37 of file keyboard_and_video.py.

tellopy.examples.keyboard_and_video.video_recorder = None

Definition at line 38 of file keyboard_and_video.py.

tellopy.examples.keyboard_and_video.wid = None

Definition at line 40 of file keyboard_and_video.py.



tello_driver
Author(s): Jordy van Appeven
autogenerated on Wed May 13 2020 03:34:54