-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Fix some bugs with mavlink2 support #1654
Fix some bugs with mavlink2 support #1654
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good and if you are happy we can merge it.
catch (std::exception& e) | ||
{ | ||
// ignore any failures here because we are running in our own thread here. | ||
Utils::log(Utils::stringf("Caught and ignoring exception sending heartbeat: %s", e.what())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is bit worry some. Why would exception occur and is there is no way to transfer this information somehow up the chain? What would be the worse case scenario here? May be exception occurs and user gets confused that nothing is happening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it is not ideal, but this function is running in an independent thread, and there is no other thread that we can transfer this to.
@@ -148,7 +148,8 @@ AsyncResult<bool> MavLinkVehicleImpl::allowFlightControlOverUsb() | |||
|
|||
void MavLinkVehicleImpl::handleMessage(std::shared_ptr<MavLinkConnection> connection, const MavLinkMessage& msg) | |||
{ | |||
unused(connection); | |||
MavLinkNodeImpl::handleMessage(connection, msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MavLinkNodeImpl needs the handleMessage also.
@@ -5101,6 +5101,36 @@ std::string MavLinkDebug::toJSon() { | |||
return ss.str(); | |||
} | |||
|
|||
int MavLinkProtocolVersion::pack(char* buffer) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would all these continue to work with MavLink 1.0 as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
Are the linux binaries compiled with this patch. Because I am facing this issue with the existing binary releases. If not, when the new binaries that are compiled with this patch will be released. |
This pull request fixes some bugs in mavlinkcom support for mavlink 2. Specifically it was not handling the new MAVLINK_MSG_ID_AUTOPILOT_VERSION message which tells all MavLinkConnections what versionh we are using (including those that are joined). This might also fix GitHub issue 1388 and 1516.