Raise a clear error when play_tune is used over MAVLink 1 - #1258
Open
Abhayindia wants to merge 1 commit into
Open
Abhayindia wants to merge 1 commit into
Abhayindia wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third fix out of the #1255 SITL sweep, after #1256 and #1257.
vehicle.play_tune()fails against any MAVLink 1 link with a confusing error that points at an unrelated message:PLAY_TUNEexists only in the MAVLink 2 dialects. I checked all four:play_tune_encodev20.ardupilotmega/v20.commonv10.ardupilotmega/v10.commonVehicle.message_factoryisself._master.mav, bound to whatever dialect the link negotiates, and the APM:Copter 3.3 binarydronekit-sitlships is from 2015, so the link comes up aspymavlink.dialects.v10.ardupilotmega. There is no MAVLink 1 equivalent to fall back to, so this raises anAPIExceptionsaying why instead.Verified against
dronekit-sitl copter. Before, the example dies on theAttributeErrorabove. After:One thing I deliberately left out of the message: I tried
MAVLINK20=1to force the newer dialect, andconnect(..., wait_ready=True)then hangs until timeout against this SITL, so suggesting it would have sent people down a dead end.Based on
master, independent of #1256 and #1257. Note that #1253 has to be applied before any example can run at all, sinceimport dronekitcurrently fails withModuleNotFoundError: No module named 'past'; I tested this change with that fix applied locally.