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

Fix some bugs with mavlink2 support #1654

Merged
merged 3 commits into from
Jan 22, 2019
Merged

Fix some bugs with mavlink2 support #1654

merged 3 commits into from
Jan 22, 2019

Conversation

clovett
Copy link
Contributor

@clovett clovett commented Dec 22, 2018

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.

Copy link
Contributor

@sytelus sytelus left a 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()));
Copy link
Contributor

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?

Copy link
Contributor Author

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.

This was referenced Dec 23, 2018
@sytelus sytelus merged commit db8281f into microsoft:master Jan 22, 2019
@Vinay545
Copy link

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.

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.

Linux binary crashing with PX4 SITL
5 participants