Skip to content

Conversation

@fnoop
Copy link
Contributor

@fnoop fnoop commented Apr 4, 2016

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
Copy link
Member

mrpollo commented Apr 12, 2016

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

@fnoop
Copy link
Contributor Author

fnoop commented Apr 12, 2016

@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
Copy link
Member

mrpollo commented Apr 12, 2016

sure thing @fnoop

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

@fnoop
Copy link
Contributor Author

fnoop commented Apr 16, 2016

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
Copy link
Contributor Author

fnoop commented Apr 17, 2016

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

@mrpollo
Copy link
Member

mrpollo commented Apr 19, 2016

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