Skip to content

Commit

Permalink
[AGENT] remove unused rotate_until function
Browse files Browse the repository at this point in the history
  • Loading branch information
JPCatarino committed Nov 10, 2021
1 parent 5a20d4d commit 058d570
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions mainRob.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,34 +138,6 @@ def run(self):
self.c1_move(ir_sensors)
else:
self.c2_brain(ir_sensors, robot_location)

def b_rotate_until(self, angle):
print("Initial:",angle, self.measures.compass, angle-self.measures.compass)

if self.measures.compass > angle:
while self.measures.compass > angle:
if abs(angle - self.measures.compass) > degrees(0.30):
self.driveMotors(+0.15, -0.15)
self.readSensors()

else:
to_rt = abs(radians(angle - self.measures.compass))
self.driveMotors(to_rt/2, -to_rt/2)
self.readSensors()

elif self.measures.compass < angle:
while self.measures.compass < angle:
if abs(angle - self.measures.compass) > degrees(0.30):
self.driveMotors(-0.15, +0.15)
self.readSensors()
else:
to_rt = abs(radians(angle - self.measures.compass))
self.driveMotors(-to_rt/2, to_rt/2)
self.readSensors()
else:
pass
self.driveMotors(0, 0)
print("Final:",angle, self.measures.compass, angle-self.measures.compass)

def rotate_until(self, angle):
print("Initial:",angle, self.measures.compass, angle-self.measures.compass)
Expand Down

0 comments on commit 058d570

Please sign in to comment.