dir2ticks function protype

This commit is contained in:
jureao 2018-03-24 20:54:02 +01:00
parent 0d2b5549c6
commit 1dc4f5a2d7

View file

@ -79,5 +79,10 @@ class Odometry:
print((self._posxy[0], self._posxy[1]))
def dir2ticks(self, destdir): # return amount of ticks to turn to a given direction (current direction should be _v_angle)
ticksperwheel = 0
self._ticksperwheel = 0
self._current_Direc = (self._v_angle /self._pi) * 180
self._ticks_def = self._current_Direc - destdir
self._ticksperwheel = self._ticks_def / 2
if self._ticksperwheel < 0:
self._ticksperwheel = - self._ticksperwheel
return ticksperwheel