reapplied commit: 0124e57

This commit is contained in:
haselnussbier 2018-03-23 19:09:49 +01:00 committed by d3rped
parent d0608fd870
commit 172e368380
2 changed files with 3 additions and 4 deletions

View file

@ -59,7 +59,6 @@ class Move:
'''
Function to correct errors should the robot wander astray
'''
# Probably redundant because aligning can be done while scanning other paths
def _aligntoedge(self):
pass
@ -88,6 +87,5 @@ class Move:
self._camera.getcolor()
if(not isknownstation):
print(self._odometry.degree(self._wheel_l.getmovement(), self._wheel_r.getmovement(), 0))
# pass # run odometry stuff here
self._wheel_l.stop()
self._wheel_r.stop()

View file

@ -4,6 +4,7 @@
import time
from planet import Direction
import math
'''
Documentation:
@ -45,8 +46,8 @@ class Odometry:
elif self.alpha % (2 * self._pi) >= self._pi * 0.25 and self.alpha % (2 * self._pi) < self._pi * 0.5 or self.alpha % (2 * self._pi) >= self._pi * 0.5 and self.alpha % (2 * self._pi) < self._pi * 0.75:
return(Direction.EAST, "Distance = ", self.distance)
elif self.alpha % (2 * self._pi)>=self._pi * 0.75 and self.alpha % (2* self._pi)< self._pi or self.alpha % (2 * self._pi) >=self._pi and self.alpha < self.alpha * 5/4 pi :
return(Direction.SOUTH,"Distance = ",self.distance)
elif self.alpha % (2 * self._pi) >= self._pi * 0.75 and self.alpha % (2 * self._pi) < self._pi or self.alpha % (2 * self._pi) >= self._pi and self.alpha % (2 * self._pi) < 5 / 4 * self._pi:
return(Direction.SOUTH, "Distance = ", self.distance)
else:
return(Direction.WEST, "Distance = ", self.distance)