Skip to content

Commit

Permalink
Fixes stationary walks in SpiralNavigation (#813)
Browse files Browse the repository at this point in the history
* Fixed sleep to use floats again

* Fixed sleep to use floats again #2

* Refactored jitter to have its own function to be used elsewhere

* Fixes SpiralNavigation skipping waypoints

* Fixing stationary movements

* Improved StepWalker
(distances lower than speed should be walked directly)
  • Loading branch information
tstumm authored and fredrik-hellmangroup committed Jul 25, 2016
1 parent 2006abd commit a035304
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pokemongo_bot/step_walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, bot, speed, initLat, initLng, destLat, destLng):

self.steps = (dist + 0.0) / (speed + 0.0)

if dist < 0.01 or self.steps < 1:
if dist < speed or self.steps < 1:
self.dLat = 0
self.dLng = 0
self.magnitude = 0;
Expand All @@ -44,7 +44,8 @@ def step(self):
# print 'distance'
# print dist

if (self.dLat == 0 and self.dLng == 0) or dist < 15:
if (self.dLat == 0 and self.dLng == 0) or dist < self.speed:
self.api.set_position(self.destLat, self.destLng, 0)
return True

totalDLat = (self.destLat - i2f(self.api._position_lat))
Expand Down

0 comments on commit a035304

Please sign in to comment.