dir2ticks function protype
This commit is contained in:
parent
0d2b5549c6
commit
1dc4f5a2d7
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue