Closed oralunal closed 8 years ago
@oralunal that is because the StepWalker does not sleep if
if (self.dLat == 0 and self.dLng == 0) or self.dist < self.speed:
i added sleep(1) to that in https://github.com/PokemonGoF/PokemonGo-Bot/pull/5169
just worth mentioning not only the Polyline walker would have been affected by this... but all tasks.. at the last step....
(polyline was affected on each step...when random speed fetch by StepWalker from 2.16 to 4.15 would have been smaller then the calculated next pos on the poyline)
This is occured in Polyline.. Now I passed to stepwalker and there is problem about speed calculation..
[2016-09-04 12:44:31] [MoveToFort] [INFO] Moving towards pokestop Vişnelik Küçük Park - 315.53m
[2016-09-04 12:44:37] [MoveToFort] [INFO] Moving towards pokestop Vişnelik Küçük Park - 300.66m
[2016-09-04 12:44:42] [MoveToFort] [INFO] Moving towards pokestop Vişnelik Küçük Park - 285.04m
[2016-09-04 12:44:48] [MoveToFort] [INFO] Moving towards pokestop Vişnelik Küçük Park - 270.33m
With this log my speed is 10 km/h.. But it should be max 4.16 km/h..
values are in m/s not km/h
thus values are between 7.8-15Km/h
4.16km/h= ~1.2m/s
@macio525: speed is calculated in m/s not km/h
@th3w4y exactly. If you take a look to my config file you'll see this:
"walk_max": 4.16,
"walk_min": 2.16,
So, there is something wrong.
4.16m/s in config, right?
No, walk_max and walk_min values are km/h
"walk_max: 4.16: Set the maximum walking speed (1 is about 1.5km/hr)" "walk_min: 2.16: Set the minimum walking speed (1 is about 1.5km/hr)"
@oralunal where is this written? that the speed are in km/h? everywhere in the code calculations and all are in m/s
@th3w4y as @macio525 mentioned it's written in configuration https://github.com/PokemonGoF/PokemonGo-Bot/blob/master/docs/configuration_files.md
@oralunal documentation is incorrect then.. it always has been m/s check even the master code..
@oralunal
Nr of steps was distance/speed
self.steps = (self.dist + 0.0) / (self.speed + 0.0)
we had steps of one second because of the sleep(1)
sleep(1) # sleep one second plus a random delta
# self._work_at_position(
# self.initLat, self.initLng,
# alt, False)
@oralunal this we have self.dist in meter decided per "self.speed" and step was one second this makes it m/s
I will update the documentation https://github.com/PokemonGoF/PokemonGo-Bot/commit/3259fb660d19276ef26427435f655f85cc0ed61d
Walking speed is an empirical number - not a real world unit.
arbitrary is probably a better word.
Plus the distance between two coords using long/lat will vary depending on where in the world we're running the bot.
@mjmadsen it kinda is a real unit is m/s
the distance variance depending on where in the world is very very small not even worth mentioning... will maybe cause more confusion...
@mjmadsen or...
do we still waist lot of time in bot.heartbeat()??
I'm not sure atm
@mjmadsen if we do.. then every second spent then make the real speed smaller...
but if i am to infer from @oralunal comment regarding 10km/h i'd guess we don't spend much time in bot.heartbeat() otherwise we will not see that speed...
def heartbeat(self):
if self.config.health_record:
current_time = time.time()
if current_time - self.heartbeat_wait > self.last_heartbeat:
self.last_heartbeat = current_time
self.track_url('/heartbeat')
That doesn't do what I expected :smile: I thought we had some timing bits in here.
Why are we even calling that from tasks and walkers? Should be somewhere higher on the foodchain
@mjmadsen it has a self.last_heartbeat default 10seconds threadsholt at least... thus runs every 10 sec...
now = time.time()
self.fort_timeouts = {id: timeout for id, timeout
in self.fort_timeouts.iteritems()
if timeout >= now * 1000}
if now - self.last_heartbeat >= self.heartbeat_threshold:
self.last_heartbeat = now
request = self.api.create_request()
request.get_player()
request.check_awarded_badges()
responses = request.call()
thus i'd guess only one in 3-4 steps are slowed by it...
@mjmadsen the one you were mentioning is a different heartbeat...
health_record.heartbeat()
@oralunal @mjmadsen let's get https://github.com/PokemonGoF/PokemonGo-Bot/pull/5169 merge to fix this issues...
Oh I see it now. Duh!
Merged
I had my max and min speed set to 6 and 5 respectively before and it ran just fine. Updated today and realized that the bot move too fast, so I tuned down max speed to 3 and min speed to 2.5, yet it's still a little faster than before.
what do you guys think... shall we bailout with a message say if average min-max > 4 ?
Expected Behavior
My speed should be between 2-4 km/h
Actual Behavior
It's like flying, He moved 270 meters in 5 secs :)
Your FULL config.json (remove your username, password, gmapkey and any other private info)
http://pastebin.com/Y3McgMeg
Output when issue occurred
http://pastebin.com/XkVLPfv1
Other Information
OS: Windows 10 Branch: dev Git Commit: 847c45bca3fa8244e00ab418308495b52b54436f
Python Version: Python 2.7.12