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
9da262fa
authored
May 03, 2024
by
Vicente Castellano Gómez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
giro implementado con curve
parent
71061912
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
robot.py
robot.py
View file @
9da262fa
...
...
@@ -14,6 +14,7 @@ class Robot:
w
=
0
velocidad
=
50
negroFlag
=
False
radiusCurve
=
20
def
__init__
(
self
):
self
.
ev3
=
EV3Brick
()
...
...
@@ -74,6 +75,18 @@ class Robot:
elif
(
ajuste
<
0
):
self
.
robot
.
turn
(
-
1
)
def
girov2
(
self
,
grados
):
self
.
giroSensor
.
reset_angle
(
0
)
self
.
robot
.
curve
(
radius
=
self
.
radiusCurve
,
angle
=
grados
)
while
(
self
.
giroSensor
.
angle
()
!=
grados
):
diferencia
=
self
.
giroSensor
.
angle
()
-
grados
ajuste
=
diferencia
*
-
1
for
i
in
range
(
abs
(
ajuste
)):
if
(
ajuste
>
0
):
self
.
robot
.
turn
(
1
)
elif
(
ajuste
<
0
):
self
.
robot
.
turn
(
-
1
)
def
giraDerecha
(
self
):
self
.
robot
.
straight
(
60
)
self
.
giro
(
90
)
...
...
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