-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
46 lines (36 loc) · 810 Bytes
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'torch'
require 'dok'
require 'image'
require 'xlua'
local help_desc = [[
Ardrone...
]]
ardrone = {}
-- load C lib
require 'libardrone'
function ardrone.new(pipe)
return libardrone.initArdrone(pipe)
end
function ardrone.release(ar)
libardrone.releaseArdrone(ar)
end
function ardrone.command(ar, fb, lr, rot, alt)
libardrone.commandArdrone(ar, fb, lr, rot, alt)
end
function ardrone.takeoff(ar, takeoff)
libardrone.takeoffArdrone(ar, takeoff)
end
function ardrone.emergency(ar, on)
libardrone.emergencyArdrone(ar, on)
end
function ardrone.initvideo()
libardrone.initVideoArdrone()
end
function ardrone.getframe(frame)
if frame == nil then
frame = torch.FloatTensor()
end
frame:resize(1, 180, 320)
libardrone.getFrameArdrone(frame)
return frame
end