giro implementado con curve

parent 71061912
Showing with 13 additions and 0 deletions
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment