Module: Tello

Defined in:
lib/tello.rb,
lib/tello/dsl.rb,
lib/tello/wifi.rb,
lib/tello/state.rb,
lib/tello/client.rb,
lib/tello/version.rb

Overview

version.rb

Defined Under Namespace

Modules: Client, DSL, Wifi

Constant Summary collapse

VERSION =
'0.2.0'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#ipObject

Flag for testing



5
6
7
# File 'lib/tello.rb', line 5

def ip
  @ip
end

#osObject

Flag for testing



5
6
7
# File 'lib/tello.rb', line 5

def os
  @os
end

#portObject

Flag for testing



5
6
7
# File 'lib/tello.rb', line 5

def port
  @port
end

#testingObject

Flag for testing



5
6
7
# File 'lib/tello.rb', line 5

def testing
  @testing
end

Class Method Details

.osObject



9
# File 'lib/tello.rb', line 9

def self.os; @os end

.stateObject



23
# File 'lib/tello/state.rb', line 23

def state; @state end

.store_state(str) ⇒ Object

Take a Tello state string, parse to a hash, and store. String in the form:

"pitch:11;roll:-18;yaw:118;vgx:0;vgy:0;vgz:0;templ:78;temph:80;tof:10;\
 h:0;bat:27;baro:-64.81;time:0;agx:242.00;agy:315.00;agz:-1057.00;\r\n"


13
14
15
16
17
18
19
20
21
# File 'lib/tello/state.rb', line 13

def store_state(str)
  str.strip!
  @state = Hash[
    str.split(';').map do |pair|
      k, v = pair.split(':', 2)
      [k.to_sym, v.to_i]
    end
  ]
end

.testingObject



7
# File 'lib/tello.rb', line 7

def self.testing; @testing end

.testing=(t) ⇒ Object



8
# File 'lib/tello.rb', line 8

def self.testing=(t); @testing=(t) end