Open cantelope opened 7 years ago
Try to change PolylineWalker to StepWalker. PolylineWalker is trying to get directions using the Google Maps API, which doesn't work very well for detailed paths with lots of stops.
Does StepWalker report altitude properly?
Apparently the task "MoveToMapPokemon" is causing your problem. This task is enable and before that the task "FollowPath", if it is before, the bot will priorize that task. If you set "enabled" to false in the "MoveToMapPokemon" task, should fix your problem.
Does StepWalker report altitude properly?
If your path includes altitude data, it sure does.
PolylineWlaker fetches Google Directions and Elevation Informations.
If your point are close in between themselves and you also have elevations then you also have no particular reason to use PolylineWalker!
But if you do it would still work (you should not get the walking you described) and would give you correct elevations for free.. when you don't have them
StepWalker only gives you a smooth transition from the last altitude you last had towards the altitude you provide...
@acurioustale I believe it should work... what issues do you have with the PolylineWalker in those cases? (Beside the fact that actually you are waisting your Google API calls for nothing... when the distance between the points in the paths is small, and the fact that you don't get much of an advantage by using it with a gpx file... Please describe the behaviour you get.. I want to identify if there are any bugs in the code...)
acurioustale commented 9 hours ago Try to change PolylineWalker to StepWalker. PolylineWalker is trying to get directions using the Google Maps API, which doesn't work very well for detailed paths with lots of stops.
@cantelope I am very interested in your case... could i get more details about the location geography?
Your walk was it on grass... pavements... how known is the location for Google? Can you overlay your gpx file over a map?
(@jmarenas in the config he attached the MoveToMapPokemon task is in the skipped tasks)
@th3w4y You are right, my bad.
FYI this is my configuration that work for me:
SO: Ubuntu Linux 16.04
Python 2.7.12
Git commit: 11123a82cb18c172a262dc9e46e7b2c175666828
{ "type": "FollowPath", "config": { "enabled": true, "walker": "StepWalker", "path_mode": "loop", "path_start_mode": "first", "path_file": "configs/points.gpx", "number_lap": -1, "timer_restart_min": "00:5:00", "timer_restart_max": "00:10:00" } }
The .gpx file that I have, I made it in gpsies.com, the file is without modification.
I identified the issue... It has to do with Google Directions not recognising the area....
When coding the Polyline I made an assumption that to go from O to D (origin destination..) i would have to insert the GooglePoints in between O..D and create a line:
O + (points returned by Google API) + D.
For unknown areas Google has only one point closest known "Postal Adress" precision thus returning only one point...
The resulting walk would be O...GooglePoint(closest_known_postal_address)...D
I will handle this in the code... if the API does not return us minim 2 points between O...D then the resulting line should be only O...D (without adding the skewed GooglePoint)
Thanks all for your assistance - did not respond as it was nighttime for me.
@acurioustale, I'd previously switched to PolylineWalker as I'd read somewhere that PolylineWalker submitted elevations to the underlying api correctly and it wasn't clear if StepWalker did so too. I guess that as long as StepWalker does elevations, I should use it for gpx paths.
I wonder, should the config.json.path.example perhaps include a comment that StepWalker is preferred for gpx files with many points and with altitude already present, whereas PolylineWalker is preferred otherwise (probably in most cases, actually).
@jmarenas, yup as th3w4y said, the MoveToMapPokemon was put into a skipped_tasks section... a throwback from a time when there was no enabled flag. Thanks for the hint on your working FollowPath config!
@th3w4y, thanks! the terrain is in a mall. Google Maps knows about it (you can zoom into it and see individual outlets), but I suspect that Google Navigation isn't able to give directions from one point to another within the mall. So it looks like your solution is the correct technical one, while the others told me how to solve my problem.
@cantelope yes i identified the issue and they provided you with the workaround...
... which you should use for now since i have no time to fix the code ATM
Expected Behavior
I physically walked along a short 1.2km path consisting of two loops and recorded my path as a .gpx file using the GPSies app. Then I reviewed this path using www.maplorer.com, which confirmed that my path was smooth and matched the two loops that I had walked. So when I feed this gpx file to my bot, I expect it to follow the path I'd reviewed at www.maplorer.com
The path is supposed to look like this![image](https://cloud.githubusercontent.com/assets/13521047/18416640/701b95fa-784c-11e6-893d-82da2f38a01b.png)
Actual Behavior
Bot is not walking that smooth path at all. Instead, it seems to be walking around semi-randomly.![image](https://cloud.githubusercontent.com/assets/13521047/18416467/9f08184c-7848-11e6-93ea-6a2e24e5b449.png)
Your FULL config.json (remove your username, password, gmapkey and any other private info)
I've added my config.json below. Note that there is no movement task in there apart from FollowPath. MoveToMapPokemon was moved into "skipped_tasks", FollowSpiral was deleted and MoveToFort is disabled. In addition, I've turned GPS xy noise and z noise to false.
{ "websocket_server": true, "heartbeat_threshold": 10, "enable_social": true, "live_config_update": { "enabled": true, "tasks_only": true }, "skipped_tasks": [ { "type": "HandleSoftBan" }, { "type": "MoveToMapPokemon", "config": { "enabled": true, "address": "http://my.ip.address:8000", "max_distance": 890, "min_time": 60, "min_ball": 50, "prioritize_vips": true, "snipe": false, "snipe_high_prio_only": true, "snipe_high_prio_threshold": 400, "update_map": true, "mode": "priority", "map_path": "raw_data", "walker": "StepWalker", "catch": { "==========Legendaries==========": 0, "Aerodactyl": 1000, "Snorlax": 1000, "Articuno": 1000, "Zapdos": 1000, "Moltres": 1000, "Dratini": 1000, "Dragonair": 1000, "Dragonite": 1000, "Mewtwo": 1000, "Mew": 1000,
}
Steps to Reproduce
I've asked on slack channel, and one idea was that PolylineWalker might be attempting to use Google Navigation to walk between each of the GPX points. That might be a good idea with json paths, but with my GPX file where each point is only 10-50m apart, I think that it should attempt to walk directly between points.
Other Information
OS: Linux Branch: dev Git Commit: cb9ebb392eeb711999b0f38c7094ab9a1eb4900c Python Version: 2.7.6