Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert changes to follow_path.py from request 4350 #4395

Merged
merged 7 commits into from
Aug 21, 2016
Merged

revert changes to follow_path.py from request 4350 #4395

merged 7 commits into from
Aug 21, 2016

Conversation

ckrmml
Copy link
Contributor

@ckrmml ckrmml commented Aug 20, 2016

Short Description:

request 4350 changes to follow_path.py crash bot

Fixes/Resolves/Closes (please use correct syntax):

  • reverted the changes

@mention-bot
Copy link

@ckrmml, thanks for your PR! By analyzing the annotation information on this pull request, we identified @kanemasa1987, @leanhdaovn and @binarydepartment to be potential reviewers

@ckrmml ckrmml closed this Aug 20, 2016
@ckrmml ckrmml changed the title revert changes from request 4350 revert changes to follow_path.py from request 4350 Aug 20, 2016
@ckrmml ckrmml reopened this Aug 20, 2016
'last_position': (last_lat, last_lng, last_alt),
'current_position': (lat, lng, alt),
'last_position': (last_lat, last_lng, 0),
'current_position': (lat, lng, 0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is not good. we have random altitude for now, please help to check if sending 0 to server.

Copy link
Contributor Author

@ckrmml ckrmml Aug 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pr 4350 crashes the bot and this is just copied over from the commit before, so better this than a crash i assume

@ckrmml
Copy link
Contributor Author

ckrmml commented Aug 20, 2016

no experience in python but the last version here is the one i run atm and it works.
sending zero 0s to the server and showing altitude in log

2016-08-21 00:22:02,400 [FollowPath] [INFO] [position_update] Walk to (50.8743004607695, 8.025789722267733, 265.99383937182523) now at (50.87421, 8.02594, 279.0), distance left: (14.5727321071 m) ..
2016-08-21 00:22:04,469 [FollowPath] [INFO] [position_update] Walk to (50.874271775232266, 8.025822849424218, 264.1504421697817) now at (50.87421, 8.02594, 279.0), distance left: (10.7122025267 m) ..
2016-08-21 00:22:06,268 [FollowPath] [INFO] [position_update] Walk to (50.8742279372137, 8.025890904249277, 282.9404947345375) now at (50.87421, 8.02594, 279.0), distance left: (3.9802946909 m) ..
2016-08-21 00:22:09,163 [FollowPath] [INFO] [position_update] Walk to (50.87421864939926, 8.02595949876614, 260.8649943459356) now at (50.87414, 8.02598, 278.0), distance left: (8.86299053737 m) ..

at least it shows the altitude of the waypoint correctly, the altitude of current position is gibberish altitude derived from config


point = self.points[self.ptr]
lat = float(point['lat'])
lng = float(point['lng'])
alt = float(point['alt'])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json files do not contain alt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gpx files do, and this is the change that allows the bot to follow path provided by gpx after your pr forced it to crash

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and gpsies.com json do contain elevation

{"data":{"trackData":[[{"lon":-118.48879337310791,"lat":34.031891963311,"ele":65},{"lon":-118.49720478057863,"lat":34.0323898728239,"ele":69}...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an option to read json files, around line 41, and they don't read alt.

Copy link
Contributor

@kanemasa1987 kanemasa1987 Aug 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if 'alt' in point:
    alt = float(point['alt'])
else:
    alt = uniform(self.bot.config.alt_min, self.bot.config.alt_max)

should keep everything good

@kanemasa1987
Copy link
Contributor

Easiest fix would probably put

_, _, alt = self.bot.api.get_position()

right before emit.

@solderzzc solderzzc merged commit 7ed96fe into PokemonGoF:dev Aug 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants