@@ -49,7 +49,7 @@ function Path:start()
49
49
if self .point [1 ].takeoff then
50
50
self .state = 1
51
51
ap .push (Ev .MCE_PREFLIGHT )
52
- sleep (2 )
52
+ sleep (1 )
53
53
ap .push (Ev .MCE_TAKEOFF )
54
54
end
55
55
end
@@ -84,7 +84,7 @@ function Path:eventHandler( e )
84
84
end
85
85
86
86
if obj_state .waypoint then
87
- ap .goToLocalPoint ( self .point [self .state ].x , self .point [self .state ].y , self .point [self .state ].z )
87
+ ap .goToLocalPoint (self .point [self .state ].x , self .point [self .state ].y , self .point [self .state ].z )
88
88
elseif obj_state .takeoff then
89
89
ap .push (Ev .MCE_PREFLIGHT )
90
90
sleep (1 )
@@ -112,15 +112,15 @@ local led_count = 29
112
112
local matrix_count = 25
113
113
local led_offset = 4
114
114
local leds = Ledbar .new (led_count )
115
- local colors = { purple = {r = 1 , g = 0 , b = 1 },
116
- cyan = {r = 0 , g = 1 , b = 1 },
117
- yellow = {r = 1 , g = 1 , b = 0 },
118
- blue = {r = 0 , g = 0 , b = 1 },
119
- red = {r = 1 , g = 0 , b = 0 },
120
- green = {r = 0 , g = 1 , b = 0 },
121
- white = {r = 1 , g = 1 , b = 1 },
122
- black = {r = 0 , g = 0 , b = 0 },
123
- brown = {r = 0.6 , g = 0.25 , b = 0.15 }
115
+ local colors = { purple = {1 , 0 , 1 },
116
+ cyan = {0 , 1 , 1 },
117
+ yellow = {1 , 1 , 0 },
118
+ blue = {0 , 0 , 1 },
119
+ red = {1 , 0 , 0 },
120
+ green = {0 , 1 , 0 },
121
+ white = {1 , 1 , 1 },
122
+ black = {0 , 0 , 0 },
123
+ brown = {0.6 , 0.25 , 0.15 }
124
124
}
125
125
126
126
-- Возвращает указатель на функцию включения матрицы заданным цветом
@@ -167,12 +167,12 @@ local tree = {
167
167
}
168
168
169
169
-- Создание нового объекта Path
170
- tree_path = Path .new ()
171
- tree_path :addTakeoff ()
170
+ my_path = Path .new ()
171
+ my_path :addTakeoff ()
172
172
for _ , v in ipairs (tree ) do
173
- tree_path :addWaypoint (unpack (v ))
173
+ my_path :addWaypoint (unpack (v ))
174
174
end
175
- tree_path :addLanding ()
175
+ my_path :addLanding ()
176
176
177
177
-- Старт выполнения полетного задания
178
- tree_path :start ()
178
+ my_path :start ()
0 commit comments