Skip to content

Commit 206779b

Browse files
committed
tree fix
1 parent cbe15b3 commit 206779b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

scripts/tree.lua

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Path:start()
4949
if self.point[1].takeoff then
5050
self.state = 1
5151
ap.push(Ev.MCE_PREFLIGHT)
52-
sleep(2)
52+
sleep(1)
5353
ap.push(Ev.MCE_TAKEOFF)
5454
end
5555
end
@@ -84,7 +84,7 @@ function Path:eventHandler( e )
8484
end
8585

8686
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)
8888
elseif obj_state.takeoff then
8989
ap.push(Ev.MCE_PREFLIGHT)
9090
sleep(1)
@@ -112,15 +112,15 @@ local led_count = 29
112112
local matrix_count = 25
113113
local led_offset = 4
114114
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}
124124
}
125125

126126
-- Возвращает указатель на функцию включения матрицы заданным цветом
@@ -167,12 +167,12 @@ local tree = {
167167
}
168168

169169
-- Создание нового объекта Path
170-
tree_path = Path.new()
171-
tree_path:addTakeoff()
170+
my_path = Path.new()
171+
my_path:addTakeoff()
172172
for _, v in ipairs(tree) do
173-
tree_path:addWaypoint(unpack(v))
173+
my_path:addWaypoint(unpack(v))
174174
end
175-
tree_path:addLanding()
175+
my_path:addLanding()
176176

177177
-- Старт выполнения полетного задания
178-
tree_path:start()
178+
my_path:start()

0 commit comments

Comments
 (0)