Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

#610: Wrap iterable call in try..except to deal with unrecognised vehicle codes - #611

Merged
mrpollo merged 4 commits into
dronekit:masterfrom
fnoop:master
Apr 19, 2016
Merged

mrpollo merged 4 commits into
dronekit:masterfrom
fnoop:master

Conversation

@fnoop

@fnoop fnoop commented Apr 4, 2016

Copy link
Copy Markdown
Contributor

Mode code isn't always in the mode mappings - for example mode 0 that GCS seem to use. Handle the exception and return a false which seems to be logically correct return in this case.

@mrpollo

mrpollo commented Apr 12, 2016

Copy link
Copy Markdown
Member

excellent contribution, would you have time to add integration tests?

@fnoop

fnoop commented Apr 12, 2016

Copy link
Copy Markdown
Contributor Author

@mrpollo - Hi, I'm brand new to git development so haven't got a clue I'm afraid. But I'd like to learn and give it a go, if you could point me in the right direction? Even just an existing example I can look at?

@mrpollo

mrpollo commented Apr 12, 2016

Copy link
Copy Markdown
Member

sure thing @fnoop

take a look at the tests we have here https://github.com/dronekit/dronekit-python/tree/master/dronekit/test/sitl

@fnoop

fnoop commented Apr 16, 2016

Copy link
Copy Markdown
Contributor Author

Note: The problem isn't that the mode code isn't in the mode mappings, it's that the mode mappings aren't created for all vehicle types, so _mode_mapping_bynumber() returns None for certain or unrecognised vehicle types (eg GCS). Thus _is_mode_available() then fails doing a lookup against a None where it's expecting a Dict.
The fix is probably still correct, I think.

@fnoop

fnoop commented Apr 17, 2016

Copy link
Copy Markdown
Contributor Author

@mrpollo added a test that triggers the bug and fails in the current master, but passes after this PR is applied

@mrpollo

mrpollo commented Apr 19, 2016

Copy link
Copy Markdown
Member

thanks for the clarification @fnoop I'm going to go ahead and merge, great work

@mrpollo
mrpollo merged commit 9b27f34 into dronekit:master Apr 19, 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.

2 participants