Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Santiago Ignacio Hitta Monteverde
firmware
Commits
947c28c3
Commit
947c28c3
authored
May 24, 2019
by
Mercedes Marzoa Tanco
Browse files
Cambios menores en el modulo distancia
parent
be594c1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
source/robot.lua
View file @
947c28c3
...
...
@@ -80,7 +80,7 @@ M.laser_ring.cb.append(M.laser_ring.get_filtering_cb())
--M.laser_ring.cb.append(M.laser_ring.get_reading_cb())
--M.color.color_cb.append(color_cb)
M
.
laser_ring
.
enable
(
true
)
--
M.laser_ring.enable(true)
--M.color.enable(true)
print
'Robot started:'
...
...
source/states/distance.lua
View file @
947c28c3
...
...
@@ -141,8 +141,8 @@ local callback_position = function()
cont_direction
=
cont_direction
+
1
end
if
(
cont_direction
>
20
)
then
cont_direction
=
-
20
if
(
cont_direction
>
15
)
then
cont_direction
=
-
15
w2
=
-
w2
omni
.
drive
(
0
,
0
,
w2
)
end
...
...
@@ -169,6 +169,7 @@ end
local
s_search
=
ahsm
.
state
{
entry
=
function
()
leds
.
clear
()
leds
.
set_all
(
37
,
42
,
10
,
true
)
angle
=
0
for
i
,
e
in
ipairs
(
e_dist
)
do
e
.
maxdist
=
0
...
...
@@ -180,7 +181,7 @@ local s_search = ahsm.state{
end
,
exit
=
function
()
leds
.
clear
()
leds
.
set_segment
(
s_far
,
10
,
0
,
10
,
true
)
--
leds.set_segment(s_far,10,0,10, true)
laser
.
cb
.
remove
(
callback_search
)
end
}
...
...
@@ -300,7 +301,10 @@ local distance = ahsm.state {
initial
=
s_search
,
entry
=
function
()
robot
.
laser_ring
.
enable
(
true
)
end
end
,
-- exit = function()
-- leds.clear()
--end,
}
return
distance
...
...
source/wifi_net.lua
View file @
947c28c3
...
...
@@ -151,7 +151,7 @@ M.init = function (conf)
conf
.
broadcast
=
conf
.
broadcast
or
nvs
.
read
(
"wifi"
,
"broadcast"
,
'255.255.255.255'
)
or
'255.255.255.255'
conf
.
announce_interval
=
conf
.
announce_interval
or
nvs
.
read
(
"wifi"
,
"announce_interval"
,
1
0
)
or
1
0
nvs
.
read
(
"wifi"
,
"announce_interval"
,
0
)
or
0
conf
.
receive_timeout
=
conf
.
receive_timeout
or
nvs
.
read
(
"wifi"
,
"receive_timeout"
,
-
1
)
or
-
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment