Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Vicente Castellano Gómez
/
robotAmbientales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fe93374e
authored
Apr 29, 2024
by
Vicente Castellano Gómez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Creacion de cola y recoger lista de movimientos
parent
26af2877
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
main.py
robot.py
main.py
View file @
fe93374e
#!/usr/bin/env pybricks-micropython
#!/usr/bin/env pybricks-micropython
from
robot
import
Robot
from
robot
import
Robot
robot
=
Robot
()
robot
=
Robot
()
\ No newline at end of file
robot.py
View file @
fe93374e
...
@@ -4,6 +4,7 @@ from pybricks.parameters import Port, Stop, Direction, Button, Color
...
@@ -4,6 +4,7 @@ from pybricks.parameters import Port, Stop, Direction, Button, Color
from
pybricks.tools
import
wait
,
StopWatch
,
DataLog
from
pybricks.tools
import
wait
,
StopWatch
,
DataLog
from
pybricks.robotics
import
DriveBase
from
pybricks.robotics
import
DriveBase
from
pybricks.media.ev3dev
import
SoundFile
,
ImageFile
from
pybricks.media.ev3dev
import
SoundFile
,
ImageFile
from
queue
import
Queue
class
Robot
:
class
Robot
:
green_rgb
=
(
35
,
55
,
39
)
green_rgb
=
(
35
,
55
,
39
)
...
@@ -19,6 +20,7 @@ class Robot:
...
@@ -19,6 +20,7 @@ class Robot:
self
.
giroSensor
=
GyroSensor
(
Port
.
S1
)
self
.
giroSensor
=
GyroSensor
(
Port
.
S1
)
self
.
colorSensor
=
ColorSensor
(
Port
.
S4
)
self
.
colorSensor
=
ColorSensor
(
Port
.
S4
)
self
.
robot
=
DriveBase
(
left_motor
,
right_motor
,
wheel_diameter
=
55.5
,
axle_track
=
124
)
self
.
robot
=
DriveBase
(
left_motor
,
right_motor
,
wheel_diameter
=
55.5
,
axle_track
=
124
)
self
.
colaMovimientos
=
Queue
()
#Metodos gestion negros
#Metodos gestion negros
def
queNegroEs
(
self
):
def
queNegroEs
(
self
):
...
@@ -89,8 +91,9 @@ class Robot:
...
@@ -89,8 +91,9 @@ class Robot:
else
:
else
:
self
.
robot
.
drive
(
0
,
50
)
self
.
robot
.
drive
(
0
,
50
)
# Recogemos la lista de movimientos del algoritmo
def
recogeListaMovimientosPedido
(
self
,
lMovimientos
):
for
movimiento
in
lMovimientos
:
self
.
colaMovimientos
.
put
(
movimiento
)
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